1 / 22

One Way ANOVA using SAS

One Way ANOVA using SAS. STT 501 Spring 2007. Example. Let’s test to see if mercury level relates to surface area as defined by the following 4 classes: low-< 75 = 'Less than 75 acres' 75 -< 250 = '75-250 acres' 250 -< 625 = '250-625 acres' 625 -high= 'More than 625 acres'. Example.

niles
Download Presentation

One Way ANOVA using SAS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. One Way ANOVA using SAS STT 501 Spring 2007

  2. Example • Let’s test to see if mercury level relates to surface area as defined by the following 4 classes: low-<75='Less than 75 acres' 75-<250='75-250 acres' 250-<625='250-625 acres' 625-high='More than 625 acres'

  3. Example • My ANOVA table should look something like: SourcedfSum of Squares S. Area Error Total • Let’s see which of these we can fill in.

  4. Totals • I can get some info for the total line from: One less than the number of observations will be our total degrees of freedom Which is our total sum of squares This requests corrected sums of squares

  5. Example • My ANOVA table should look something like: SourcedfSum of Squares S. Area Error Total 119 13.2169 • OK, we can get error as well.

  6. Error • We can get corrected sums of squares in each group and pool them: Should get 12.4578 Take one less than each of these and add them to get error d.f. 29+30+ 27+30= 116 The sum of these is my error sum of squares

  7. Example • My ANOVA table should look something like: SourcedfSum of Squares S. Area Error 116 12.4578 Total 119 13.2169 • Now get the rest by subtraction...

  8. Example • My ANOVA table should look something like: SourcedfSum of Squares S. Area 3 0.7591 Error 116 12.4578 Total 119 13.2169 • And we should be able to construct the mean squares and the F-test

  9. ANOVA Procedures • There are several procedures in SAS that can conduct the ANOVA, we’ll use GLM (General Linear Model). • To get the analysis of mercury level vs. surface area category:

  10. ANOVA Procedures Identifies the group variable Required, since we’ve constructed groups with a format

  11. ANOVA Procedures The model is always of the form: response = group(s)

  12. ANOVA Procedures Note that SAS is a bit redundant here In multi-factor cases, the model sum of squares will be a sum of all the factors, which are then separated at the bottom. Since surface area is the only factor here, its sum of squares is the same as the model. This should be the same as our ANOVA table

  13. Multiple Comparisons • From the results of our ANOVA, we see moderately significant evidence that mercury level is related to surface area category. • At this point, it would likely be useful to compare mercury levels across surface area categories.

  14. Multiple Comparisons • We can get means for the response variable in each group using the means statement, and we can ask for comparisons as well. • Several multiple comparisons are available, including: Bonferroni adjusted t-tests, Tukey’s W, Ryan’s Q and Dunnett’s test.

  15. Example Starred (***) comparisons are significant. Note that these 2 are actually 1, it’s a bit redundant in its listing Check this note, Bonferroni is not best for all pair-wise comparisons Requests comparisons based on the Bonferroni adjustment Sets the experiment-wise error rate

  16. Example I can request Tukey’s method, the output is of a similar form (with similar results for this case).

  17. Example I also get an interesting note here. If I include the lines option (I can do this with bon as well), I get a bit different form of output, where groups that are not significantly different are marked.

  18. Example For unequal group sizes, it will use an approximation based on the harmonic mean of the group sizes. In fact, this is used when the lines option is specified. This approx. should be avoided if group sizes are very different: largest/smallest > 1.5 Ryan’s Q will always give output in a grouping form. This is because Ryan’s Q is designed for equal group sizes. We can request Ryan’s Q

  19. Comparison with a Control • Dunnett’s test for comparing each group to a control (or a predetermined group with every other group) is available. • We’ll use the birth weight data to check for differences in birth weight versus smoking status, taking non-smokers as a control.

  20. Example How did it know that 0 was the control? Well, of course, it didn’t know that. By default the first value (in alphabetical or numeric order) is taken as the control. Requesting the Dunnett test here gets a comparison of 0 (non-smoker) to every other.

  21. Example I get comparisons to current smokers. Not what I want… but currently smoke is first alphabetically. If I use this format…

  22. Example I can specify the control category. NOTE: it is case sensitive, so make sure you match it exactly.

More Related