Descriptions of post-hoc tests

Similar documents
Odor attraction CRD Page 1

dm'log;clear;output;clear'; options ps=512 ls=99 nocenter nodate nonumber nolabel FORMCHAR=" = -/\<>*"; ODS LISTING;

This is a Randomized Block Design (RBD) with a single factor treatment arrangement (2 levels) which are fixed.

Chapter 8 (More on Assumptions for the Simple Linear Regression)

This is a Split-plot Design with a fixed single factor treatment arrangement in the main plot and a 2 by 3 factorial subplot.

unadjusted model for baseline cholesterol 22:31 Monday, April 19,

Outline. Topic 19 - Inference. The Cell Means Model. Estimates. Inference for Means Differences in cell means Contrasts. STAT Fall 2013

T-test: means of Spock's judge versus all other judges 1 12:10 Wednesday, January 5, judge1 N Mean Std Dev Std Err Minimum Maximum

EXST7015: Estimating tree weights from other morphometric variables Raw data print

1) Answer the following questions as true (T) or false (F) by circling the appropriate letter.

5.3 Three-Stage Nested Design Example

Linear Combinations of Group Means

ANALYSIS OF VARIANCE OF BALANCED DAIRY SCIENCE DATA USING SAS

Covariance Structure Approach to Within-Cases

17. Example SAS Commands for Analysis of a Classic Split-Plot Experiment 17. 1

Handout 1: Predicting GPA from SAT

EXST Regression Techniques Page 1. We can also test the hypothesis H :" œ 0 versus H :"

A posteriori multiple comparison tests

Laboratory Topics 4 & 5

Pairwise multiple comparisons are easy to compute using SAS Proc GLM. The basic statement is:

Linear Combinations. Comparison of treatment means. Bruce A Craig. Department of Statistics Purdue University. STAT 514 Topic 6 1

1 Tomato yield example.

COMPREHENSIVE WRITTEN EXAMINATION, PAPER III FRIDAY AUGUST 26, 2005, 9:00 A.M. 1:00 P.M. STATISTICS 174 QUESTION

Chapter 11. Analysis of Variance (One-Way)

Introduction to SAS proc mixed

Biological Applications of ANOVA - Examples and Readings

Introduction to Design and Analysis of Experiments with the SAS System (Stat 7010 Lecture Notes)

Statistical Methods I

STAT 5200 Handout #23. Repeated Measures Example (Ch. 16)

Introduction to SAS proc mixed

Multiple Comparisons

Lecture 3. Experiments with a Single Factor: ANOVA Montgomery 3.1 through 3.3

4.8 Alternate Analysis as a Oneway ANOVA

Chapter 11 : State SAT scores for 1982 Data Listing

Statistics for exp. medical researchers Comparison of groups, T-tests and ANOVA

Subject-specific observed profiles of log(fev1) vs age First 50 subjects in Six Cities Study

Cuckoo Birds. Analysis of Variance. Display of Cuckoo Bird Egg Lengths

MIXED MODELS FOR REPEATED (LONGITUDINAL) DATA PART 2 DAVID C. HOWELL 4/1/2010

The program for the following sections follows.

Multiple t Tests. Introduction to Analysis of Variance. Experiments with More than 2 Conditions

ANOVA Longitudinal Models for the Practice Effects Data: via GLM

SAS Commands. General Plan. Output. Construct scatterplot / interaction plot. Run full model

Lecture 3. Experiments with a Single Factor: ANOVA Montgomery 3-1 through 3-3

N J SS W /df W N - 1

Week 7.1--IES 612-STA STA doc

Analysis of Variance

EXST 7015 Fall 2014 Lab 11: Randomized Block Design and Nested Design

STAT 5200 Handout #7a Contrasts & Post hoc Means Comparisons (Ch. 4-5)

SAS Syntax and Output for Data Manipulation: CLDP 944 Example 3a page 1

COMPLETELY RANDOM DESIGN (CRD) -Design can be used when experimental units are essentially homogeneous.

Analysis of Variance

Comparison of a Population Means

Answer Keys to Homework#10

Assignment 9 Answer Keys

Lec 1: An Introduction to ANOVA

The One-Way Independent-Samples ANOVA. (For Between-Subjects Designs)

SAS Procedures Inference about the Line ffl model statement in proc reg has many options ffl To construct confidence intervals use alpha=, clm, cli, c

Chapter 9. Multivariate and Within-cases Analysis. 9.1 Multivariate Analysis of Variance

General Linear Models (GLM) for Fixed Factors

Introduction to the Analysis of Variance (ANOVA) Computing One-Way Independent Measures (Between Subjects) ANOVAs

Answer to exercise: Blood pressure lowering drugs

Chapter 1 Statistical Inference

The entire data set consists of n = 32 widgets, 8 of which were made from each of q = 4 different materials.

One-Way Analysis of Covariance (ANCOVA)

Lecture 10: Experiments with Random Effects

BE640 Intermediate Biostatistics 2. Regression and Correlation. Simple Linear Regression Software: SAS. Emergency Calls to the New York Auto Club

Analysis of variance and regression. April 17, Contents Comparison of several groups One-way ANOVA. Two-way ANOVA Interaction Model checking

WITHIN-PARTICIPANT EXPERIMENTAL DESIGNS

Outline. Topic 20 - Diagnostics and Remedies. Residuals. Overview. Diagnostics Plots Residual checks Formal Tests. STAT Fall 2013

STAT 115:Experimental Designs

Topic 25 - One-Way Random Effects Models. Outline. Random Effects vs Fixed Effects. Data for One-way Random Effects Model. One-way Random effects

Specific Differences. Lukas Meier, Seminar für Statistik

Topic 17 - Single Factor Analysis of Variance. Outline. One-way ANOVA. The Data / Notation. One way ANOVA Cell means model Factor effects model

Repeated Measures Part 2: Cartoon data

STAT22200 Spring 2014 Chapter 5

SAS Syntax and Output for Data Manipulation:

Multiple Testing. Gary W. Oehlert. January 28, School of Statistics University of Minnesota

Analysis of Variance (ANOVA)

Multiple Comparison Procedures Cohen Chapter 13. For EDUC/PSY 6600

BIOL Biometry LAB 6 - SINGLE FACTOR ANOVA and MULTIPLE COMPARISON PROCEDURES

Topic 12. The Split-plot Design and its Relatives (continued) Repeated Measures

2 Hand-out 2. Dr. M. P. M. M. M c Loughlin Revised 2018

Introduction. Chapter 8

UNIVERSITY OF TORONTO. Faculty of Arts and Science APRIL 2010 EXAMINATIONS STA 303 H1S / STA 1002 HS. Duration - 3 hours. Aids Allowed: Calculator

Analysis of Longitudinal Data: Comparison Between PROC GLM and PROC MIXED. Maribeth Johnson Medical College of Georgia Augusta, GA

PLS205 Lab 6 February 13, Laboratory Topic 9

Single Factor Experiments

Analysis of variance. April 16, Contents Comparison of several groups

Analysis of variance. April 16, 2009

Topic 23: Diagnostics and Remedies

Booklet of Code and Output for STAC32 Final Exam

Lecture 5: Comparing Treatment Means Montgomery: Section 3-5

Lecture 4. Random Effects in Completely Randomized Design

Group comparison test for independent samples

Your schedule of coming weeks. One-way ANOVA, II. Review from last time. Review from last time /22/2004. Create ANOVA table

Lecture notes on Regression & SAS example demonstration

PLS205!! Lab 9!! March 6, Topic 13: Covariance Analysis

Introduction to Analysis of Variance (ANOVA) Part 2

Topic 20: Single Factor Analysis of Variance

STA 303H1F: Two-way Analysis of Variance Practice Problems

Transcription:

Experimental Statistics II Page 81 Descriptions of post-hoc tests Post-hoc or Post-ANOVA tests! Once you have found out some treatment(s) are different, how do you determine which one(s) are different? For the moment we will be concerned only with examining for differences among the treatment levels. We will assume that we have already detected a significant difference among treatments levels with ANOVA. So, having rejected the Null hypothesis we wish to determine how the treatment levels interrelate. This is the post-anova part of the analysis. These tests fall into two general categories. Post hoc tests (LSD, Tukey, Scheffé, Duncan's, Dunnett's, etc.) A priori tests or pre-planned comparisons (contrasts) A priori tests are better. These are tests that the researcher plans on doing before they gather data, and if we dedicate 1 d.f. to each one we generally feel comfortable doing each at some specified level of alpha. However, since multiple tests do entail risks of higher experiment wide error rates, it would not be unreasonable to apply some technique, like Bonferroni's adjustment, to insure an experimentwise error rate of the desired level of alpha ( ). So how might we do these post hoc tests? The simplest approach would be to do pairwise test of the treatments using something like the two-sample t-test. If you are interested in testing between treatment level means, then you probably have fixed effects. If the levels were randomly selected from a large number of possible choices we would probably not be interested in the individual levels chosen. This tests examines the null hypothesis H 0 : or H 0 : 0, against the alternative H 0 : 0 or H 0 : 0 or H 0 : 0. Recall two things about the two-sample t-test. First, in a t-test we had to determine if the variance was equal for the two populations tested. We tested H : with an F test to determine if this was the case. 2 2 0 Second, the variance of the test (variance of the difference between 1 and 2) was equal to 2 2. This is a variance for the linear combination from our null hypothesis, that is, the n n variance of is 2 2 2 2 1 ( 1), if the variables are independent. If the variance are equal (as they are often assume to be for ANOVA) then the variance is 2 1 1. We estimate 2 with the mean square error (MSE). n n

Experimental Statistics II Page 82 Y1 Y2 So, we would test each pair of means using the two sample t-test as t 2 1 1 S n n p( ). For ( Y1 Y2 ) ANOVA, using the MSE as our variance estimate, we have t. If the design 1 1 MSE n n ( Y1 Y2 ) is balanced this simplifies this to t. 2MSE n Notice that if the calculated value of t is greater than the tabular value of t, we would reject the null hypothesis. To the contrary, if the calculated value of t is less than the tabular value we would fail to reject. ( Y Call the tabular value t*, and write the case for rejection of H 0 as 1 Y2 ) t. 2MSE n ( Y So we would reject H 0 if 1 Y2 ) t ( Y 2 1 Y2 ) t MSE n. or if t 2 MSE 2MSE ( Y Y n ) n or So, for any difference ( Y1 Y 2) that is greater than t 2MSE n we find the difference between the means to be statistically significant (reject H 0 ), and for any value less than this value we find the difference to be consistent with the null hypothesis. Right? This value of t 2MSE n is what R. A. Fisher called the Least Significant Difference, commonly called the LSD (not to be confused with the Latin Square Design = LSD). 1 1 LSD tcritical MSE( n n ) or LSD tcriticals Y1 Y2 This value is the exact width of an interval Y1 Y 2 which would give a t-test equal to t critical. Any larger values would be significant and any smaller values would not. This is called the Least Significant Difference. LSD t S critical Y1 Y2 We calculate this value for each pair of differences and if the observed difference is less, the treatments are not significantly different. If greater they are significantly different. One last detail. I have used the simpler version of the variance assuming that n 1 = n 2. If the experiment is unbalanced (i.e. there are unequal numbers of observations in the treatment 1 1 levels) then the value is MSE. n n

Experimental Statistics II Page 83 The property of balance is nice because all of the pairwise tests have the same sample sizes and the same standard error. However, balance is not necessary. For an 1 1 unbalanced design we must calculate the standard error ( MSE ) for each n n pairwise test because they will be different. This is the first of our post ANOVA tests, it is called the LSD. But hey, wait a minute! Didn't Fisher invent ANOVA in the first place to avoid doing a bunch of separate t-tests? So, now we are doing a bunch of separate t-tests. What is wrong with this picture? So, this is Fishers solution. When we do a bunch of separate t-tests, we don't know if there are any real differences at the level. After we do the ANOVA test we know that there are some differences. So we only do the LSD if the ANOVA says that there are actually differences, otherwise, don't do the LSD. This is called Fisher's Protected LSD: we use the LSD ONLY if the ANOVA shows differences, otherwise we are NOT justified in using the LSD. Makes sense. But there were still a lot of nervous statisticians looking for something a little better. As a result there are MANY alternative calculations. We will discuss the classic solutions. This least significant difference calculation can be used to either do pairwise tests on observed differences or to place a confidence interval on observed differences. The LSD can be done in SAS in one of two ways. The MEANS statement produces a range test (LINES option) or confidence intervals (CLDIFF option), while the LSMEANS statement gives pairwise comparisons. Other Post ANOVA tests Basically, we calculate the LSD with our chosen value of. We then do our mean comparisons. Each test has a pairwise error rate of. We have already seen one alternative, the Bonferroni adjustment. If we do 5 tests, or 10 tests, our error rate is no more than 5( /2) or 10( /2). Generally, for g tests our error rate is no more than g( /2). To keep an experiment wide error rate of, we simply do each comparison using a t value for an a equal to /2g. For two tailed tests (which are the most common) we do each test at /2 and the Bonferroni test would use a t for an error rate of Dunnetts test discussed below.. One tailed tests are possible, but usually only done with 2g The Bonferroni adjustment is fine if we are only doing a few tests. However, it is an upper boundary of the error, the highest that the error can be. The real probability of error is actually less, perhaps much less. So if we are doing very many tests, Bonferroni gets very conservative, giving us an actual error rate much lower than the we really want. So we seek alternatives. The major applications are Tukey's and Scheffé's. We will also consider Dunnett's and Duncan's since they are fairly commonly. Each of the tests is discussed below.

Experimental Statistics II Page 84 The LSD has an probability of error on each and every test or for each comparison. It is called to as a comparisonwise error rate. The whole idea of ANOVA is to give a probability of error that is for the whole experiment, so, much work in statistics has been dedicated to this problem. Some of the most common and popular alternatives are discussed below. Most of these are also discussed in your textbook. The LSD is the LEAST conservative of those discussed, meaning it is the one most likely to detect a difference and it is also the one most likely to make a Type I error when it finds a difference. However, since it is unlikely to miss a difference that is real, it is also the most powerful. The probability distribution used to produce the LSD is the t distribution. Bonferroni's adjustment. Bonferroni pointed out that in doing k tests, each at a probability of Type I error equal to, the overall experimentwise probability of Type I error will be NO MORE than k*, where k is the number of tests. Therefore, if we do 7 tests, each at =0.05, the overall rate of error will be NO MORE than =0.35, or 35%. So, if we want to do 7 tests and keep an error rate of 5% overall, we can do each individual test at a rate of /k = 0.05/7 = 0.007143. For the 7 tests we have an overall rate of 7*0.007143 = 0.05. The probability distribution used to produce the LSD is the t distribution. Duncan's multiple range test. This test is intended to give groupings of means that are not significantly different among themselves. The error rate is for each group, and has sometimes been called a familywise error rate. This is done in a manner similar to Bonferroni, except the calculation used to calculate the error rate is [1(1 ) r1 ] instead of the sum of. For comparing two means that are r steps apart, where for adjacent means r=2. Two means separated by 3 other means would have r = 5, and the error rate would be [1(1 ) r1 ] = [1(1 0.05) 4 ] = 0.1855. The value of a needed to keep an error rate of is the reverse of this calculation, [1(10.05) 1/4 ] = 0.0127. The Student-Neuman-Keuls test The value of is calculated as similar test to Duncans, controlling the familywise error rate. 1 1 r /2. It is Tukey's adjustment. This test seems to be most appropriate in most cases since it keeps an error rate for all possible pairwise tests for the whole experiment, which is often what an investigator wants to do. This test basically allows for all pairwise tests and keeps an experimentwise error rate of for all pairwise tests. The Tukey adjustment allows for, Tukey developed his own tables (see Appendix table A.7 in your book, Percentage points of the studentized range). For t treatments and a given error degrees of freedom the table will provide 5% and 1% error rates that give an experimentwise rate of Type I error. Note SAS puts HSD by Tukey's. This stands for Honest Significant Difference. Scheffé's adjustment This test is the most conservative. It allows the investigator to do all possible tests, and still maintain an experimentwise error rate of. All possible tests includes not only all pairwise tests, but comparisons of all possible combinations of treatments 3 4 5 with other combinations of treatments (e.g. H 0 : 2 3, CONTRASTS will be covered later). The calculation is based on a square root of the F distribution, and can be used for range type tests or confidence intervals. The test is more general than the others mentioned, for the special case of pairwise comparisons.

Experimental Statistics II Page 85 The critical value for Scheffés test is based on the F distribution. The statistic is given by t 1 *F t 1, n(t 1) for a balanced design with t treatments and n observations per treatment. This test is appropriate for data dredging. Place the post-hoc tests above in order from the one most likely to detect a difference (and the one most likely to be wrong) to the one least likely to detect a difference (and the one least likely to be wrong). LSD is first, followed by Duncan's test, Tukey's and finally Scheffé's. Dunnett's is a special test that is similar to Tukey's, but for a specific purpose, so it does not fit well in the ranking. The Bonferroni approach produces an upper bound on the error rate, so it is conservative for a given number of tests. It is a useful approach if you want to do a few tests, fewer than allowed by one of the others (e.g. you may want to do just a few and not all possible pairwise). In this case, the Bonferroni may be better. Note that if you want to do a couple of pairwise tests you can calculate Bonferroni and compare the critical value to Tukey's. Tukey's is for all pairwise tests and would be conservative for fewer than all pairwise tests. Bonferroni may be overly conservative because it is a bound. For other sets of tests including some that are not pairwise, compare Bonferroni to Scheffé. Post ANOVA test comparison Comparisonwise error rate: LSD Experimentwise error rate: Tukey (all pairwise), Bonferroni (selected tests), Scheffé (all possible contrasts). When doing pairwise tests, the LSD is the test most likely to find differences, and the one most likely to be wrong when it finds a difference. However, power is the ability to find differences, so although error prone in the type I error sense, the LSD is the most powerful of the tests. Scheffé is the test least likely to find a difference, and least likely to be wrong with respect to type I error. Other tests that are used in particular circumstances. We will mention only Dunnett's, which is used to compare one treatment (usually a control) to all other treatments. This is the only post hoc test in SAS that has one-tailed tests (e.g. DUNNETTL and DUNNETTU). Applying Post ANOVA test comparisons All of these tests can be expressed in one of two ways. If the analysis is BALANCED, then there is a popular expression of pairwise tests that starts with ranked means. Suppose we calculate a value of the LSD equal to 8, and we have sorted the means of treatment levels and have 5, 14, 17, 23, 29, and 38. Treatment Level Mean Groups 3 38 9 6 23 5 17 2 14 4 5 If the critical value of the LSD = 8 then means below that differ by less than 8 do not differ statistically. This is represented by giving them a common letter so they share a letter.

Experimental Statistics II Page 86 For an LSD critical value of 8 Same means compared with a Tukey adjusted critical value of 10 Same means compared with a Scheffé adjusted critical value of 15 Treatment Level Mean Groups 3 38 A 9 B 6 23 B C 5 17 D C 2 14 D 4 5 E Treatment Level Mean Groups 3 38 A 9 A B 6 23 B C 5 17 C 2 14 C D 4 5 D Treatment Level Mean Groups 3 38 A 9 A B 6 23 A B 5 17 B C 2 14 B C 4 5 C SAS Example (Appendix 12a) Note the test of homogeneity of variance (random or repeated statement). Test the effects of TREATMENTS. Post hoc tests : They can be done from MIXED using the LSMeans statement. In GLM either the MEANS or LSMeans statement can be used. SAS statements results to compare (post ANOVA or post hoc tests ) Results with the LSD Results with Tukey's. Results with Scheffé's. Results with Dunnett's. NOTE that normally only one post-anova examination would be done. We have done several here in order to compare. Note the use of a macro to get sorted and labeled means to indicate significant differences.

ANOVA & Post ANOVA tests CRD and RBD examples Page 240 1 dm'log;clear;output;clear'; 2 options ps=512 ls=99 nocenter nodate nonumber; 3 TITLE1 'Appendix12: Comparing Cuckoo egg sizes'; 4 5 ODS HTML style=minimal body='c:\sas\appendix12 Cuckoo.HTML' ; NOTE: Writing HTML Body file: C:\SAS\Appendix12 Cuckoo.HTML 6 *ODS rtf style=minimal body='c:\sas\appendix12 Cuckoo.RTF' ; 7 *ODS PDF style=minimal body='c:\sas\appendix12 Cuckoo.PDF' ; 8 filename input1 'C:\SAS\Appendix12 Cuckoo.dat'; 9 FILENAME OUT1'C:\SAS\Appendix12 Cuckoo01.CGM'; 10 FILENAME OUT2'C:\SAS\Appendix12 Cuckoo02.CGM'; 11 FILENAME OUT3'C:\SAS\Appendix12 Cuckoo03.CGM'; 12 13 ****************************************************************************; 14 *** Source: L.H.C. Tippett, The Methods of Statistics, 4th Edition, ****; 15 *** John Wiley and Sons, Inc., 1952, p. 176. ****; 16 *** Description: L.H.C. Tippett (1902-1985) was one of the pioneers ****; 17 *** in the field of statistical quality control, This data on the ****; 18 *** lengths of cuckoo eggs found in the nests of other birds (drawn ****; 19 *** from the work of O.M. Latter in 1902) is used by Tippett in his ****; 20 *** fundamental text. Cuckoo are knows to lay their eggs in the nests ****; 21 *** of other (host) birds. The eggs are then adopted and hatched by ****; 22 *** the host birds. ****; 23 ****************************************************************************; 24 *** That cuckoo eggs were peculiar to the locality where found was ****; 25 *** already known in 1892. A study by E.B. Chance in 1940 called The ****; 26 *** Truth About the Cuckoo demonstrated that cuckoos return year after ****; 27 *** year to the same territory and lay their eggs in the nests of a ****; 28 *** particular host species. Further, cuckoos appear to mate only within****; 29 *** their territory. Therefore, geographical sub-species are developed, ****; 30 *** each with a dominant foster-parent species, and natural selection ****; 31 *** has ensured the survival of cuckoos most fitted to lay eggs that ****; 32 *** would be adopted by a particular foster-parent species. ****; 33 ****************************************************************************; 34 36 data cuckoo; infile input1 missover; 37 Input S1 S2 S3 S4 S5 S6; 38 HostSpecies='Meadow Pipit'; EggLt=s1; if egglt ne. then output; 39 HostSpecies='Tree Pipit'; EggLt=s2; if egglt ne. then output; 40 HostSpecies='Hedge Sparrow'; EggLt=s3; if egglt ne. then output; 41 HostSpecies='Robin'; EggLt=s4; if egglt ne. then output; 42 HostSpecies='Pied Wagtail'; EggLt=s5; if egglt ne. then output; 43 HostSpecies='Wren'; EggLt=s6; if egglt ne. then output; 44 keep HostSpecies EggLt; 45 datalines; NOTE: The infile INPUT1 is: File Name=C:\SAS\Appendix12 Cuckoo.dat, RECFM=V,LRECL=256 NOTE: 45 records were read from the infile INPUT1. The minimum record length was 45. The maximum record length was 45. NOTE: The data set WORK.CUCKOO has 120 observations and 2 variables. NOTE: DATA statement used (Total process time): 0.01 seconds 0.00 seconds 45! run; 46 ; 47 48 proc sort data=cuckoo; by HostSpecies; run; NOTE: There were 120 observations read from the data set WORK.CUCKOO. NOTE: The data set WORK.CUCKOO has 120 observations and 2 variables. NOTE: PROCEDURE SORT used (Total process time): 0.00 seconds 0.00 seconds

ANOVA & Post ANOVA tests CRD and RBD examples Page 241 49 proc print data=cuckoo; run; NOTE: There were 120 observations read from the data set WORK.CUCKOO. NOTE: The PROCEDURE PRINT printed page 1. NOTE: PROCEDURE PRINT used (Total process time): 0.09 seconds 0.01 seconds 50 TITLE2 'RAW DATA LISTING'; RUN; Appendix12: Comparing Cuckoo egg sizes Obs hostspecies EggLt 1 Hedge Sparrow 20.85 2 Hedge Sparrow 21.65 3 Hedge Sparrow 22.05 4 Hedge Sparrow 22.85 5 Hedge Sparrow 23.05 6 Hedge Sparrow 23.05 7 Hedge Sparrow 23.05 8 Hedge Sparrow 23.05 9 Hedge Sparrow 23.45 10 Hedge Sparrow 23.85 11 Hedge Sparrow 23.85 12 Hedge Sparrow 23.85 13 Hedge Sparrow 24.05 14 Hedge Sparrow 25.05 15 Meadow Pipit 19.65 16 Meadow Pipit 20.05 17 Meadow Pipit 20.65 18 Meadow Pipit 20.85 19 Meadow Pipit 21.65 20 Meadow Pipit 21.65 21 Meadow Pipit 21.65 22 Meadow Pipit 21.85 23 Meadow Pipit 21.85 24 Meadow Pipit 21.85 25 Meadow Pipit 22.05 26 Meadow Pipit 22.05 27 Meadow Pipit 22.05 28 Meadow Pipit 22.05 29 Meadow Pipit 22.05 30 Meadow Pipit 22.05 31 Meadow Pipit 22.05 32 Meadow Pipit 22.05 33 Meadow Pipit 22.05 34 Meadow Pipit 22.05 35 Meadow Pipit 22.25 36 Meadow Pipit 22.25 37 Meadow Pipit 22.25 38 Meadow Pipit 22.25 39 Meadow Pipit 22.25 40 Meadow Pipit 22.25 41 Meadow Pipit 22.25 42 Meadow Pipit 22.25 43 Meadow Pipit 22.45 44 Meadow Pipit 22.45 45 Meadow Pipit 22.45 46 Meadow Pipit 22.65 47 Meadow Pipit 22.65 48 Meadow Pipit 22.85 49 Meadow Pipit 22.85 50 Meadow Pipit 22.85 51 Meadow Pipit 22.85 52 Meadow Pipit 23.05 53 Meadow Pipit 23.25 54 Meadow Pipit 23.25 55 Meadow Pipit 23.45 56 Meadow Pipit 23.65 57 Meadow Pipit 23.85 58 Meadow Pipit 24.25 59 Meadow Pipit 24.45 60 Pied Wagtail 21.05 61 Pied Wagtail 21.85 62 Pied Wagtail 21.85 63 Pied Wagtail 21.85 64 Pied Wagtail 22.05 65 Pied Wagtail 22.45 66 Pied Wagtail 22.65 67 Pied Wagtail 23.05 68 Pied Wagtail 23.05 69 Pied Wagtail 23.25 70 Pied Wagtail 23.45 71 Pied Wagtail 24.05 72 Pied Wagtail 24.05 73 Pied Wagtail 24.05 74 Pied Wagtail 24.85 75 Robin 21.05 76 Robin 21.85 77 Robin 22.05 78 Robin 22.05 79 Robin 22.05 80 Robin 22.25 81 Robin 22.45 82 Robin 22.45 83 Robin 22.65 84 Robin 23.05 85 Robin 23.05 86 Robin 23.05 87 Robin 23.05 88 Robin 23.05 89 Robin 23.25 90 Robin 23.85 91 Tree Pipit 21.05 92 Tree Pipit 21.85 93 Tree Pipit 22.05 94 Tree Pipit 22.45 95 Tree Pipit 22.65 96 Tree Pipit 23.25 97 Tree Pipit 23.25 98 Tree Pipit 23.25 99 Tree Pipit 23.45 100 Tree Pipit 23.45 101 Tree Pipit 23.65 102 Tree Pipit 23.85 103 Tree Pipit 24.05 104 Tree Pipit 24.05 105 Tree Pipit 24.05 106 Wren 19.85 107 Wren 20.05 108 Wren 20.25 109 Wren 20.85 110 Wren 20.85 111 Wren 20.85 112 Wren 21.05 113 Wren 21.05 114 Wren 21.05 115 Wren 21.25 116 Wren 21.45 117 Wren 22.05 118 Wren 22.05 119 Wren 22.05 120 Wren 22.25 51 52 goptions reset=all device=cgmlt97l gsfname=out2 gsfmode=replace 53 ftext='swissx' ftitle='swissx'; 54 55 GOPTIONS GSFNAME=OUT2; 56 proc boxplot data = cuckoo; plot EggLt * HostSpecies; run ; NOTE: Processing beginning for PLOT statement number 1. NOTE: 172 RECORDS WRITTEN TO C:\SAS\Appendix12 Cuckoo02.CGM NOTE: 59 RECORDS WRITTEN TO C:\SAS\sasgraph\boxplot.gif NOTE: There were 120 observations read from the data set WORK.CUCKOO. NOTE: PROCEDURE BOXPLOT used (Total process time): 0.48 seconds 0.14 seconds

ANOVA & Post ANOVA tests CRD and RBD examples Page 242 26 25 24 Egg length 23 22 21 20 19 Hedge Sparrow Meadow Pipit Pied Wagtail Robin Host species Tree Pipit Wren 58 PROC MIXED DATA=Cuckoo cl covtest; CLASSES HostSpecies; 59 TITLE2 'Analysis of Variance with PROC MIXED'; 60 TITLE3 'This model tests for non-homogeniety'; 61 MODEL EggLt = HostSpecies / htype=3 DDFM=Satterthwaite; 62 repeated / group=hostspecies; 63 LSMEANS HostSpecies / ADJUST=Dunnett pdiff; 64 run; NOTE:Convergence criteria met. NOTE: The PROCEDURE MIXED printed page 2. NOTE: PROCEDURE MIXED used (Total process time): 0.12 seconds 0.04 seconds Analysis of Variance with PROC MIXED This model tests for non-homogeniety The Mixed Procedure Model Information Data Set Dependent Variable Covariance Structure Group Effect Estimation Method Residual Variance Method Fixed Effects SE Method Degrees of Freedom Method WORK.CUCKOO EggLt Variance Components hostspecies REML None Model-Based Satterthwaite Class Level Information Class Levels Values hostspecies 6 Hedge Sparrow Meadow Pipit Pied Wagtail Robin Tree Pipit Wren Dimensions Covariance Parameters 6 Columns in X 7 Columns in Z 0 Subjects 120 Max Obs Per Subject 1

ANOVA & Post ANOVA tests CRD and RBD examples Page 243 Number of Observations Number of Observations Read 120 Number of Observations Used 120 Number of Observations Not Used 0 Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 319.17021907 1 1 314.57973727 0.00000000 Convergence criteria met. Covariance Parameter Estimates Z Cov Parm Group Estimate Error Value Pr Z Alpha Lower Upper Residual hostspecies Hedge Sparrow 1.1422 0.4480 2.55 0.0054 0.05 0.6003 2.9645 Residual hostspecies Meadow Pipit 0.8476 0.1807 4.69 <.0001 0.05 0.5809 1.3524 Residual hostspecies Pied Wagtail 1.1398 0.4308 2.65 0.0041 0.05 0.6109 2.8350 Residual hostspecies Robin 0.4687 0.171.74 0.0031 0.05 0.2557 1.1226 Residual hostspecies Tree Pipit 0.8126 0.307.65 0.0041 0.05 0.4355 2.0211 Residual hostspecies Wren 0.5531 0.209.65 0.0041 0.05 0.2965 1.3758 FitStatistics -2 Res Log Likelihood 314.6 AIC (smaller is better) 326.6 AICC (smaller is better) 327.4 BIC (smaller is better) 343.3 Null Model Likelihood Ratio Test DF Chi-Square Pr > ChiSq 5 4.59 0.4679 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F hostspecies 5 35 12.73 <.0001 Testing for a difference between full and reduced models. Full model -2LL = 314.6 Reduced model -2LL = 319.2 d.f. difference = 5 (i.e. 6 variance model versus 1 variance model) Chi sq = 319.2-314.6 = 4.6 P > Chi Sq = 0.466616283 Least Squares Means Effect hostspecies Estimate Error DF t Value Pr > t hostspecies Hedge Sparrow 23.1214 0.2856 13 80.95 <.0001 hostspecies Meadow Pipit 22.2989 0.1372 44 162.48 <.0001 hostspecies Pied Wagtail 22.9033 0.2757 14 83.09 <.0001 hostspecies Robin 22.5750 0.1711 15 131.90 <.0001 hostspecies Tree Pipit 23.0900 0.2327 14 99.21 <.0001 hostspecies Wren 21.1300 0.1920 14 110.03 <.0001 Differences of Least Squares Means Effect hostspecies _hostspecies Estimate Error DF t Value Pr > t Adjustment Adj P hostspecies Meadow Pipit Hedge Sparrow -0.8225 0.3169 19.4-2.60 0.0176 Dunnett 0.0464 hostspecies Pied Wagtail Hedge Sparrow -0.2181 0.3970 26.9-0.55 0.5873 Dunnett 0.9535 hostspecies Robin Hedge Sparrow -0.5464 0.3330 21.6-1.64 0.1153 Dunnett 0.2982 hostspecies Tree Pipit Hedge Sparrow -0.03143 0.3685 25.5-0.09 0.9327 Dunnett 1.0000 hostspecies Wren Hedge Sparrow -1.9914 0.3442 23-5.79 <.0001 Dunnett <.0001 66 PROC MIXED DATA=Cuckoo cl covtest; CLASSES HostSpecies; 67 TITLE2 'Analysis of Variance with PROC MIXED'; 68 TITLE3 'This model assumes homogeniety'; 69 MODEL EggLt = HostSpecies / htype=3 DDFM=Satterthwaite outp=resids; 70 LSMeans HostSpecies / pdiff adjust=tukey CL; 71 LSMEANS HostSpecies / ADJUST=Scheffe pdiff; 72 LSMEANS HostSpecies / ADJUST=Bon pdiff; 73 *Order: Hedge_Sparrow Meadow_Pipit Pied_Wagtail Robin Tree_Pipit Wren; 74 Contrast 'Pipits v others' HostSpecies - -1 - -1; 75 Contrast 'Wren sized v others' HostSpecies -1-1 -1-1 -1 5; 76 ods output diffs=ppp lsmeans=mmm;

ANOVA & Post ANOVA tests CRD and RBD examples Page 244 77 ods listing exclude diffs;* lsmeans; 78 run; NOTE: The data set WORK.MMM has 18 observations and 10 variables. NOTE: The data set WORK.PPP has 45 observations and 15 variables. NOTE: The data set WORK.RESIDS has 120 observations and 9 variables. NOTE: The PROCEDURE MIXED printed page 3. NOTE: PROCEDURE MIXED used (Total process time): 0.17 seconds 0.07 seconds 79 80 TITLE4 'Post hoc adjustment with macro by Arnold Saxton'; 81 * SAS Macro by Arnold Saxton: Saxton, A.M. 1998. A macro for ; 82 * converting mean separation output to letter groupings in Proc Mixed. ; 83 * In Proc. 23rd SAS Users Group Intl., SAS Institute, Cary, NC, pp1243-1246.; 84 %include 'C:\SAS\pdmix800.sas'; 712 %pdmix800(ppp,mmm,alpha=0.05,sort=yes); RUN; PDMIX800 03.26.2002 processing 4.5640841628 Tukey-Kramer values for hostspecies are 1.0067 (avg) 0.85413 (min) 1.09047 (max). 713 %include 'C:\pdmix800.sas'; Analysis of Variance with PROC MIXED This model assumes homogeniety The Mixed Procedure Model Information Data Set Dependent Variable Covariance Structure Estimation Method Residual Variance Method Fixed Effects SE Method Degrees of Freedom Method WORK.CUCKOO EggLt Diagonal REML Profile Model-Based Residual Class Level Information Class Levels Values hostspecies 6 Hedge Sparrow Meadow Pipit ied Wagtail Robin Tree Pipit Wren Dimensions Covariance Parameters 1 Columns in X 7 Columns in Z 0 Subjects 1 Max Obs Per Subject 120 Number of Observations Number of Observations Read 120 Number of Observations Used 120 Number of Observations Not Used 0 Covariance Parameter Estimates Z Cov Parm Estimate Error Value Pr Z Alpha Lower Upper Residual 0.8267 0.1095 7.55 <.0001 0.05 0.6480 1.0916

ANOVA & Post ANOVA tests CRD and RBD examples Page 245 Fit Statistics -2 Res Log Likelihood 319.2 AIC (smaller is better) 321.2 AICC (smaller is better) 321.2 BIC (smaller is better) 323.9 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value Pr > F hostspecies 5 114 10.39 <.0001 Contrasts Num Den Label DF DF F Value Pr > F Pipits v others 1 114 2.13 0.1469 Wren sized v others 1 114 43.00 <.0001 Least Squares Means Effect hostspecies Estimate Error DF t Value Pr > t Alpha Lower Upper hostspecies Hedge Sparrow 23.1214 0.2430 114 95.15 <.0001 0.05 22.6400 23.6028 hostspecies Meadow Pipit 22.2989 0.1355 114 164.51 <.0001 0.05 22.0304 22.5674 hostspecies Pied Wagtail 22.9033 0.2348 114 97.56 <.0001 0.05 22.4383 23.3684 hostspecies Robin 22.5750 0.2273 114 99.31 <.0001 0.05 22.1247 23.0253 hostspecies Tree Pipit 23.0900 0.2348 114 98.35 <.0001 0.05 22.6249 23.5551 hostspecies Wren 21.1300 0.2348 114 90.00 <.0001 0.05 20.6649 21.5951 hostspecies Hedge Sparrow 23.1214 0.2430 114 95.15 <.0001... hostspecies Meadow Pipit 22.2989 0.1355 114 164.51 <.0001... hostspecies Pied Wagtail 22.9033 0.2348 114 97.56 <.0001... hostspecies Robin 22.5750 0.2273 114 99.31 <.0001... hostspecies Tree Pipit 23.0900 0.2348 114 98.35 <.0001.. hostspecies Wren 21.1300 0.2348 114 90.00 <.0001... hostspecies Hedge Sparrow 23.1214 0.2430 114 95.15 <.0001... hostspecies Meadow Pipit 22.2989 0.1355 114 164.51 <.0001... hostspecies Pied Wagtail 22.9033 0.2348 114 97.56 <.0001... hostspecies Robin 22.5750 0.2273 114 99.31 <.0001... hostspecies Tree Pipit 23.0900 0.2348 114 98.35 <.0001... hostspecies Wren 21.1300 0.2348 114 90.00 <.0001... Effect=hostspecies Method=Bonferroni(P<0.05) Set=3 Letter Obs hostspecies Estimate Error Alpha Lower Upper Group 1 Hedge Sparrow 23.1214 0.2430... A 2 Tree Pipit 23.0900 0.2348... A 3 Pied Wagtail 22.9033 0.2348... A 4 Robin 22.5750 0.2273... A 5 Meadow Pipit 22.2989 0.1355... A 6 Wren 21.1300 0.2348... B Effect=hostspecies Method=Scheffe(P<0.05) Set=2 Letter Obs hostspecies Estimate Error Alpha Lower Upper Group 7 Hedge Sparrow 23.1214 0.2430... A 8 Tree Pipit 23.0900 0.2348... A 9 Pied Wagtail 22.9033 0.2348... A 10 Robin 22.5750 0.2273... A 11 Meadow Pipit 22.2989 0.1355... A 12 Wren 21.1300 0.2348... B Effect=hostspecies Method=Tukey-Kramer(P<0.05) Set=1 Letter Obs hostspecies Estimate Error Alpha Lower Upper Group 13 Hedge Sparrow 23.1214 0.2430 0.05 22.6400 23.6028 A 14 Tree Pipit 23.0900 0.2348 0.05 22.6249 23.5551 A 15 Pied Wagtail 22.9033 0.2348 0.05 22.4383 23.3684 AB 16 Robin 22.5750 0.2273 0.05 22.1247 23.0253 AB 17 Meadow Pipit 22.2989 0.1355 0.05 22.0304 22.5674 B 18 Wren 21.1300 0.2348 0.05 20.6649 21.5951 C

ANOVA & Post ANOVA tests CRD and RBD examples Page 246 760 options ps=512 ls=132; 761 PROC UNIVARIATE DATA=Resids PLOT NORMAL; VAR resid; 762 ods exclude basicmeasures extremeobs quantiles testsforlocation; 763 TITLE2 'Analysis of residuals from PROC MIXED'; 764 RUN; NOTE: SAS set option OBS=0 and will continue to check statements. This may cause NOTE: No observations in data set. NOTE: PROCEDURE UNIVARIATE used (Total process time): 0.00 seconds 0.00 seconds Analysis of residuals from PROC MIXED The UNIVARIATE Procedure Variable: Resid (Residual) Moments N 120 Sum Weights 120 Mean 0 Sum Observations 0 Std Deviation 0.88994547 Variance 0.79200293 Skewness -0.3213104 Kurtosis 0.6104145 Uncorrected SS 94.2483492 Corrected SS 94.2483492 Coeff Variation. Std Error Mean 0.08124053 Tests for Normality Test --Statistic--- -----p Value------ Shapiro-Wilk W 0.980402 Pr < W 0.0776 Kolmogorov-Smirnov D 0.101523 Pr > D <0.0100 Cramer-von Mises W-Sq 0.143407 Pr > W-Sq 0.0295 Anderson-Darling A-Sq 0.820169 Pr > A-Sq 0.0348 Stem Leaf # Boxplot Normal Probability Plot 20 5 1 0 2.1+ ++* 18 355 3 **+* 16 +++ 14 5 1 ++* 12 85 2 ++** 10 25555 5 +*** 8 222355666 9 ***** 6 833356 6 +** 4 88888555556 11 +-----+ *** 2 2355566 7 *** 0 8255555666 10 + +*** -0 22888777755555555 17 *-----* **** -2 2888755555555555 16-0.3+ **** -4 22255554 8 +-----+ ***+ -6 25554 5 **++ -8 85 2 **+ -10 875554 6 *** -12 84 2 +* -14 275 3 +** -16 5 1 +++* -18 5 1 ++ * -20 4 1 0 ++ * -22 75 2 0 + * * -24-26 5 1 0-2.7+* ----+----+----+----+ +----+----+----+----+----+----+----+----+----+----+ Multiply Stem.Leaf by 10**-1-2 -1 0 +1 +2