Presentation is loading. Please wait.

Presentation is loading. Please wait.

Statistics Used in One-way Analysis of Variance BUSI 6480 Lecture 2.

Similar presentations


Presentation on theme: "Statistics Used in One-way Analysis of Variance BUSI 6480 Lecture 2."— Presentation transcript:

1 Statistics Used in One-way Analysis of Variance BUSI 6480 Lecture 2

2 Design of Experiments: A historical note Two spoonfuls of vinegar three times a day (and 4 other treatments for scurvy) lost out to oranges and lemons in what Wikipedia credits as an "early" designed experiment. James Lind

3 Design of Experiments: A historical note In 1747, while serving as surgeon on HM Bark Salisbury, James Lind, the ship's surgeon, carried out a controlled experiment to develop a cure for scurvy. Lind selected 12 men from the ship, all suffering from scurvy, and divided them into six pairs, giving each group different additions to their basic diet for a period of two weeks. The treatments were all remedies that had been proposed at one time or another. They were:  A quart of cider every day  Twenty five gutts of elixir vitriol three times a day upon an empty stomach,vitriol  One half-pint of seawater every day  A mixture of garlic, mustard, and horseradish in a lump the size of a nutmeg  Two spoonfuls of vinegar three times a day  Two oranges and one lemon every day.

4 Design of Experiments: A historical note The men who had been given citrus fruits recovered dramatically within a week. One of them returned to duty after 6 days and the other became nurse to the rest. The others experienced some improvement, but nothing was comparable to the citrus fruits, which were proved to be substantially superior to the other treatments. In this study his subjects' cases "were as similar as I could have them", that is he provided strict entry requirements to reduce extraneous variation. The men were paired, which provided replication. From a modern perspective, the main thing that is missing is randomized allocation of subjects to treatments.

5 ANOVA: Testing hypothesized values of  2  A standard assumption is that the data come from a normally distributed population. The groups are assumed to have equal population variances.  H 0 :  2 =  0 2 H A :  2   0 2  H 0 :  2   0 2 H A :  2 >  0 2   2 =(n-1) /   2 where is the sample variance and   2 is the hypothesized variance.

6 F statistic for ANOVA  Ratio of two chi-square statistics F = (  v1 2 /v 1 )/ (  v2 2 / v 2 ) where v 1 and v 2 are the numerator and denominator degrees of freedom. E(F) = v 2 /(v 2 – 2) Thus, expected value of F is approximately one.

7 Model for One-way Anova Y ij =  +  j +  i(j) where  j is a fixed effect, i = 1,..., n; j = 1,..., p H 0 :  1 =  1 =... =  p = 0 H 1 :  j  0 for some j Y ij = + ( - ) + ( Y ij - ) Score Grand TreatmentError mean effect effect = SST = SSB + SSW

8 Notation for Sums of Squares = [AS] /np = [Y] /n = [A] The Letter A represents all observations belonging to a level of treatment A. The notation [A] means to square the sum of Y’s within each treatment level and divide by the number of observations within each level of treatment A. The letters AS represent the treatment and subject within the treatment level. The notation [AS] means to square the sum of observations within each subject treatment level. Note that there is only one observation within each subject treatment level. The letter Y represents all observations of the dependent variable. The notation [Y] means to square the sum of all response observations and divide by the number of responses.

9 Sums of Squares using Symbols  SST = [AS] –[Y]  SSB = [A] – [Y]  SSW = [AS] – [A] Three terms are used in computing the sums of squares for a one-way ANOVA

10 Expected Values of Error Terms  E(  i(j) ) =   = 0  E(  i(j) ) = n   = 0  E(  i(j) 2 ) = n     E(  i(j) ) 2 = n     E(  i(j) 2 ) = np   2  E(  i(j) ) 2 = np   2

11 Expected Value of Mean Sum of Squares for the Fixed Effects CR-p Design  E(MSB) =   2 +  E(MSW) =   2  E(F) ≈ E(MSB)/E(MSW) = (   2 + ) /   2  If H 0 is true and all  j = 0, then E(F) ≈ 1. What is the E(SSB)? What is the E(SSW)?

12 Expected Value of Mean Sum of Squares for the Random Effects CR-p Design  E(MSB) =   2 + n   2  E(MSW) =   2  E(F) ≈ E(MSB)/E(MSW) = (   2 + n   2 ) /   2  If H 0 is true and all   2 = 0, then E(F) ≈ 1.  Remember for a random effects model  i is a random variable with mean 0 and variance   2. What is the E(SSB)? What is the E(SSW)?

13 How do you know what ratio of sums of squares to form for the F test?  By finding the expected Mean Sum of Squares, the F statistic can be correctly computed. This will become handy as the designs become more complicated.  The expected values of the mean squares for the fixed and random effects model lead to the same ratios of mean sums of squares for the CR-p design. This will not always be true for more complex designs.

14 Assumptions for CR-p F Assumptions 1. Data come from normally distributed populations. 2. Observations within cells are random or at least observations are randomly assigned to cells. (Cells are determined by treatment levels.) 3. Numerator and denominator of F statistic are independent. 4. Numerator and denominator are estimates of the same population variance,   2, when H 0 is true.

15 Model Assumptions for CR-p  The model Y ij =  +  j +  i(j) contains all the sources of variation that affect Y ij.  The experiment contains all the treatment levels of interest.  The error effect,  i(j) is (a) independent of other error terms, (b) normally distributed within each treatment level, ( c) mean is equal to zero, and (d) variance is constant (   2 ) across treatment level.

16 Testing for Homogeneity of Variance  H 0 :  1 2 =  2 2 = … =  p 2

17 Levene Test / Brown-Forsythe Test for testing for homogeneity of variance  Levene's test is an alternative to the Bartlett test. It is less sensitive than the Bartlett test to departures from normality. If there is strong evidence that the data do in fact come from a normal, or nearly normal distribution, then Bartlett's test has better performance.Bartlett test  Levene’s test: replace each observation by the absolute value of the deviation of the observation from the group mean and run a one-way ANOVA.  Brown-Forsythe test: modify Levene’s test by using the deviation of each observation from the group median instead of the group mean.

18 HOV: Homogeneity of Variance If the null hypothesis is rejected use the Welch or Brown-Forsythe test ANOVA test on the means. Assume 5% significance level as the default value.

19 Transformation of the Dependent Variable to Achieve HOV or Normality – more effective with unequal group sizes.

20 Rules of Thumb for Transformations of Y

21 Plotting Group Variances to Determine Transformation. Plot the variance of the group (treatment level) by the group mean (x-axis). Draw a straight line (least squares line) through the points and find the slope, . Use p = 1-  to determine the transformation of the form: y = x p Round off p and use the closest transformation listed.

22 Another method for selecting the transformation Use the Smallest Range Criteria

23 Kruskal Wallis: Nonparametric Counterpart to the One-way ANOVA

24 Guidelines for Alternative Tests

25 Run the following Data using SAS and SPSS (select HOV and Welch options) one way ANOVA  /* SAS Commands ***/  DM "Log;Clear;OUT;Clear;" ;  Data mydata;  Input Treat1 Treat2 Treat3;  datalines;  17 18 15  13 12 16  18 26 19  10 18 17  11 9 18  16 30 17  19 12 19  ;

26 Create one column of responses and another column with the grouping variable  Data Treat1;  set mydata;  resp = Treat1;  Data Treat2;  set mydata;  resp = Treat2;  Data Treat3;  set mydata;  resp = Treat3;  Data myAnovaData;  Set Treat1 Treat2 Treat3;  If _N_ <= 21 then Level = 3;  If _N_ <= 14 then Level = 2;  If _N_ <= 7 then Level = 1;  Keep resp Level;  proc print data = myAnovaData;  proc export data=myAnovaData outfile='d:MyAnovaDatainColformat.dat' dbms=dlm replace;

27 SAS proc to get Welch and Levine HOV test  proc glm data = myAnovaData;  class Level;  model resp = Level;  means Level / hovtest welch ;  run;  quit;

28 SPSS Analyze > Compare Means > One-Way ANOVA

29 SPSS Options for the One-Way ANOVA Test for Equal Group Variances Test for Means assuming unequal variances


Download ppt "Statistics Used in One-way Analysis of Variance BUSI 6480 Lecture 2."

Similar presentations


Ads by Google