Stat6305 — Unit4: PartialSolutions 9

4.1.1. (a) Label c1 and c2 of a Minitab worksheet as Gar1 and Gar 2, respectively. Then cut these data from [the unit] and paste them into c1 and c2. (When pasting, put the cursor in the first row of c1; use spaces as delimiters). (b)Anticipating our work in the next section, put the differences in bids into c3, labeled Diff.... (c)Print the results to the Session Window and verify that they are correct....

The results of the above instructions are as follows:

MTB > print c1 c2 c3

Data Display

Row Gar 1 Gar 2 Diff

1 7.6 7.3 0.3

2 10.2 9.1 1.1

3 9.5 8.4 1.1

4 1.3 1.5 -0.2

5 3.0 2.7 0.3

6 6.3 5.8 0.5

7 5.3 4.9 0.4

8 6.2 5.3 0.9

9 2.2 2.0 0.2

10 4.8 4.2 0.6

11 11.3 11.0 0.3

12 12.1 11.0 1.1

13 6.9 6.1 0.8

14 7.6 6.7 0.9

15 8.4 7.5 0.9

4.1.2. Suppose that you have 30 randomly chosen damaged cars available. How could this experiment have been designed in order to produce data that are not paired? Rewrite the first sentence of this section (above the data) to indicate the experimental procedure you have in mind to produce two independent columns of data. Which design, paired or independent, do you think is best for the purpose at hand, and why?

To produce data that was not paired, the first sentence of the section would be rewritten as follows:

“Insurance adjusters randomly picked 15 cars from 30 damaged cars available and sent them to Garage 1 to obtain repair estimates. The remaining 15 cars were sent to Garage 2 to obtain repair estimates.”

The paired design is better for the purpose of determining whether average estimates from Garage 1 are different from those from Garage 2. If an independent design were used, the large variability in the damage to individual cars is more likely to obscure a relatively small difference between garages: by chance, one garage may get more many more heavily damaged cars.

4.1.3. Return now to the original paired-data experiment. It can be viewed as a two-factor experiment. One factor is Garage and the other is Car.... [O]ne of the factors is fixed and the other is random. Which is the fixed factor, which is the random factor, and why?

Garage is the fixed factor because the two garages were chosen as being of "particular interest" to the insurance adjusters conducting the experiment. (The garages were not chosen at random from among all auto repair garages in the region. If the experiment were to be repeated next month to verify the results from the current data, the same two garages would be used.)

Car is a random factor because the 15 cars were chosen at random. (The adjusters do not care about these particular cars. These 15 cars are of interest only for what they can tell us about the bidding behavior of the two garages. If the experiment were to be repeated next month to verify the results from the current data, a new sample of 15 cars would be chosen. In fact, the current 15 cars would no doubt be repaired and in use by their owners — not available for use in a new experiment.)

Note: In this simple experiment, the result of the statistical analysis does not hinge on whether we correctly identify fixed and random factors. But this distinction between fixed and random effects turns out to be crucial in more complex designs.

4.2.1. It was claimed above that we should expect the bids by the two garages to be associated. (For example, a heavily damaged car will get a high bid at both garages.) Make a scatterplot of Gar1 vs. Gar2 and describe what you see. (Where do the points lie relative to the line Gar 1 = Gar2?) Use either character or pixel graphics; note that the syntax for gpro mode requires an asterisk (*) between the column numbers.

MTB > gstd [Necessary unless standard graphics mode previously declared. Professional graphics mode is the default.]

MTB > plot c1 c2

Scatterplot

-

12.0+ *

- *

Gar1 - *

- *

- *

8.0+ * *

- *

- * *

- *

- *

4.0+

- *

- *

- *

-

0.0+

------+------+------+------+------+------Gar2

2.0 4.0 6.0 8.0 10.0

MTB > gpro [Not necessary if text (standard) graphics mode has not been declared earlier]

MTB > plot c1 * c2

Either way: The points are nearly on a straight line, indicating a strong association between paired bids from Garage 1 and Garage 2. It seems that Garage 1 tends to give higher bids: most points lie above the line
y (Gar 1) = x (Gar 2).


4.2.2. Reproduce the two dotplots on the same scale as shown [in the unit]. Make a printout and connect each dot for Garage 1 with the corresponding dot (same damaged car) for Garage 2.

Because we cannot easily show handwritten lines here, we show results from Minitab's "Interactions Plot" where the required lines are drawn by Minitab. (The label "Mean" for the vertical axis is supplied by Minitab; a better label for out data would be "Hundreds of Dollars".) In this graphic, only the lowest colored line slopes upwards.


4.3.1. “Looking at the dotplot of differences one may legitimately wonder whether they are normally distributed. Perform one of the three formal tests of normality available in the menu path STAT Þ Basic Þ Normality. Give the
P-value and say what it indicates. Also try the normal probability plot in the menu path GRAPH Þ Probability plot Þ Single, Distribution "normal". What device does the latter plot use to help you judge whether the data are normal?”

The "basic normality" results in the following graphic.

The P-value of the Anderson-Darling test is .232. Because this p-value is greater than .05, normality cannot be rejected at the 5% significance level. The somewhat nonlinear pattern of the points is caused by repeated values in the Differences at .3, .9, and 1.1. (Perhaps the data have been rounded a bit too much, or perhaps they are just made-up numbers.)

The Ryan-Joiner test gives the same plot and the P-value is reported as "> 0.100".

The Kolmogorov-Smirnov test gives the same plot and the P-value is reported as ">0.150".

Ordinarily we will use the Anderson-Darling test in this class.

For a very brief explanation of the distinctions among these tests and references to papers, you could use Help Þ Search, and enter "Ryan Joiner" and select "Choosing a normality test". (ECDF is the acronym for empirical cumulative distribution function.)

In addition to the Anderson-Darling statistic and associated P-value, this plot provides 95% confidence bands. These bands are helpful to beginning students, who wonder how far from a straight line is "too far to be normal."

Here, all the points are clearly within the bands, as is consistent with the large P-value. Again, there is no evidence of nonnormality.

4.3.2. If one chose to do a nonparametric test, either a sign test (STAT Þ Nonparametrics Þ 1-Sample Sign; command stest 0 c3) or a Wilcoxon signed-rank test (STAT Þ Nonparametrics Þ 1-Sample Wilcoxon; command wtest 0 c3) would be appropriate. Remember that, for these tests, the null hypothesis is that the population of differences has zero median. Perform both tests, give P-values, and interpret the results.

The results of the sign test and Wilcoxon signed-rank tests are as follows:

Sign Test for Median: Diff

Sign test of median = 0.00000 versus not = 0.00000

N Below Equal Above P Median

Diff 15 1 0 14 0.0010 0.6000

Wilcoxon Signed Rank Test: Diff

Test of median = 0.000000 versus median not = 0.000000

N

for Wilcoxon Estimated

N Test Statistic P Median

Diff 15 15 118.5 0.001 0.6250

The P-values in both cases are much less than .05, indicating rejection of the null hypothesis that the population of the differences has 0 median.

In general, the Wilcoxon test is more powerful that the sign test (more likely to reject when the population really
isn't 0). In effect, the sign test looks only at whether differences are positive or negative. If the null hypothesis is true, then the positives and negatives should be distributed like Heads and Tails in tossing a fair coin. The exact
P-value of the sign test is the probability that 15 tosses of a fair coin would yield 0, 1, 14, or15 Heads. You can find the total probability in Minitab from the table produced by MTB > pdf; with SUBC> bino 15 .5. Alternatively, in R: sum(dbinom(c(0,1,14,15), 15, .5)) returns 0.0009765625, which rounds to .001.

4.4.1. Which format would you choose if you were presenting data in a report, stacked or unstacked? Give reasons briefly.

In a report, it is usually best to present the data in unstacked format, which is seems more natural to a non-technical audience. In addition to columns for Garage 1 and Garage 2, one should include a Car column with numbers 1-15 to make it clear that each car provides a pair of measurements. Also, it might be well to include a column of differences. To save space on the page, perhaps data can be displayed in rows rather than columns.

4.4.2. How could the data table at the very beginning of this unit be modified to make it clearer to the reader that the data are paired and that each row shows the results for a particular car?

As suggested in 4.4.1, in addition to the Garage 1 and Garage 2 columns, include a Car column to make it clear that each pair refers is the same car.

4.4.3. In conducting an experiment such as this one, damaged cars would be sampled and then each car would be taken to the two garages to get bids for repair. Perhaps the toss of a coin would decide whether a particular car was taken to Garage 1 or Garage 2 first. Which format, stacked or unstacked, would be natural for recording the results of this experiment as data collection progresses?

It would be more natural to record the data in unstacked format, since each garage would not necessarily create bids with the cars in the same order. In stacked format, the two subscript columns (for Garage and Car) give the complete information on the design before the issue of randomized order was raised. Now a third subscript column Order (with values 1 or 2) would be required to show whether a bid was the first or second obtained for a particular car. There is no need for the rows to be presented in any particular order. In practice, the natural order would be time order with a columns denoting the date and time of the bid, the person who took the car to the garage for a bid, the person at the garage who provided the bid, and so on. Ideally, data would be entered in chronological order as the experiment progresses, perhaps with column(s) giving the date (and also time) when a bid is received.

4.5.1. Suppose we want to use the fixed significance level 1% for testing whether there is a difference between the two garages. Find the critical values for both the paired t test and the F test of the block procedure. Show that the square of the critical values of t is the critical value of F.

The output of the invcdf from Minitab for the t and F distributions is as follows:

Inverse Cumulative Distribution Function

MTB > invcdf .995;

SUBC> t 14.

Student's t distribution with 14 DF

P( X <= x ) x

0.995 2.97684

MTB > invcdf .99;

SUBC> f 1 14.

Inverse Cumulative Distribution Function

F distribution with 1 DF in numerator and 14 DF in denominator

P( X <= x ) x

0.99 8.86159

The 99% critical value for the t test is 2.97684. The critical value for the F test 8.86159.
Note that Ö8.86159 = 2.97684.

A two-sided t-test rejects in either of two tails each with probability .005 under the null hypothesis, for a total significance level of 2(.004) = 1%. Because of the squaring in the computation of the F-statistic, this is equivalent to a one-sided F-test, rejecting only in the right tail with probability .01 under the null hypothesis.


4.5.2. “Use Minitab's general linear model procedure (STAT > ANOVA > GLM) to get mainly the same output as at the beginning of this section. Notice that the standardized residuals for one of the cars are (barely) greater than 2 in absolute value and hence the observations for that car are noted as "unusual." Which car? Make a boxplot of the residuals (or standardized residuals). What outliers, if any, are indicated?”

The commands below do the same thing as the indicated menu path (with appropriate items filled in and selected).

MTB > glm Bid = Garage Car;

SUBC> random Car;

SUBC>.resid c14.

MTB > name c14 'RESI1".

General Linear Model: Bid versus Garage, Car

Factor Type Levels Values

Garage fixed 2 1, 2

Car random 15 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15

Analysis of Variance for Bid, using Adjusted SS for Tests