The Big Picture Elements of Experimental Design The Big Picture The primary goal of experimental designs is to compare different treatments Completely Randomized Design and Random Effects Experimental units are individuals to which treatments are applied Elements of design include Bret Larget Replication to assess variability Randomization to control selection bias Blocking to control known sources of variability Departments of Botany and of Statistics University of Wisconsin Madison In a completely randomized design experimental units from a single homogeneous group are assigned at random to treatments March 8 2007 In a randomized complete block design experimental units are grouped with similar units into blocks and then assigned at random to treatments within blocks Statistics 572 Spring 2007 CRD and Random Effects The Big Picture March 8 2007 1 11 Fixed and Random Effects March 8 2007 2 11 Model Data When a blocking variable or in general a categorical variable consists of all groups of interest it is appropriate to model the effects of this variable as fixed When a blocking variable or in general a categorical variable is thought of as a sample of groups from some larger population of possible groups it is appropriate to model the effects of this variable as random Random effects models involve multiple sources of random variation We will begin with a review of a fixed effects models and then show how the model changes with random effects CRD and Random Effects CRD and Random Effects CRD One Way ANOVA Fixed and Random Effects Statistics 572 Spring 2007 Statistics 572 Spring 2007 March 8 2007 3 11 A categorical variable has k levels or treatments There are ni observations in the ith level for i 1 k The jth observation in the ith level is yij for j 1 ni The model for the observed data is yij i eij eij iidN 0 e2 where i is the population mean for the ith treatment group j 1 ni i 1 k An alternative expression of the model is eij iidN 0 e2 P where is the grand population mean k1 ki 1 i and i i is the difference between the ith trt mean and the grand mean P Note that ki 1 i 0 This parameterization is not the default in R yij i eij Statistics 572 Spring 2007 CRD and Random Effects March 8 2007 4 11 CRD One Way ANOVA Balanced Designs CRD One Way ANOVA Balanced Designs Balanced Designs ANOVA for Balanced Designs In a balanced design sample sizes are equal in each treatment group ni n for all i The ANOVA table for a balanced design is Source df SS MS Trt k 1 SSTrt MSTrt Error k n 1 SSErr MSErr Total kn 1 SSTot Equations associated with ANOVA F tests are simpler in balanced designs The hypothesis of equal treatment means is equivalent to the hypothesis that all treatment effects are zero H0 1 2 k versus Ha not all i s are equal H0 i 0 for all i versus Ha not all i 0 Under model assumptions the F statistic has an F distribution with k 1 and k n 1 degrees of freedom Sums of squares have these formula SSTot SSTrt SSErr Pk Pn 2 i 1 j 1 yij y on df Pk n y i y 2 on df k Pi 1 k Pn 2 i 1 j 1 yij y i on df F MSTrt MSErr kn 1 The estimated variance is e2 MSErr 1 k n 1 where y is the grand mean and y i is the ith group mean Statistics 572 Spring 2007 CRD and Random Effects CRD One Way ANOVA March 8 2007 5 11 Statistics 572 Spring 2007 Balanced Designs CRD and Random Effects Randomization Expected Mean Square EMS March 8 2007 6 11 Why randomize Randomization Both MSTrt and MSErr are random quantities Each has a distribution and an expected value Facts for balanced designs E MSErr e2 E MSTrt e2 n Randomization provides a way to control potential selection bias Pk 2 i 1 i k 1 If unknown factors affect the response variable with randomization these factors are likely to be fairly balanced by the treatment allocation It follows for balanced designs that E MSTrt E MSErr 1 P n ki 1 i2 1 e2 k 1 If known factors affect the response these factors should be measured and included in the model or in the design with blocking For unbalanced designs there is a messier formula but the same basic principle holds When treatment effects i are not all zero the ratio of expected values is greater than one The F test is significant when the ratio is large enough Statistics 572 Spring 2007 CRD and Random Effects March 8 2007 7 11 Statistics 572 Spring 2007 CRD and Random Effects March 8 2007 8 11 Randomization Randomization in R Random Effects Randomization in R Motivation Motivating Example Example 1 The sample function in R can be used to allocate individuals to treatment groups at random Here is an example to allocate 20 individuals into treatment groups A B C and D equally The function rep repeats the first argument some number of times The function sample with only one argument places the elements of the argument in a random order trt rep c A B C D each 5 trt 1 C C A B B A B A D C A C D D B C D D B 20 A Random Effects March 8 2007 9 11 Models Models Fixed effect model yij i eij eij iidN 0 e2 P where ki 1 i 0 Random effect model yij ai eij j 1 ni i 1 k where ai is the class effect with ai iidN 0 a2 and eij is the error due to variability from student to student with eij iidN 0 e2 and the ai are independent of the eij Often a2 and e2 are called variance components Statistics 572 Spring 2007 CRD and Random Effects Of interest is the reading skill among all second grade classes in Madison Take a random sample of 8 classes Within each class take a random sample of 10 students and measure their reading skills In Example 1 we want to compare 8 specific classes and hence the class effect is fixed In Example 2 we want to assess the variabilities among classes and use a random sample of the classes to make inference about all the classes in Madison Hence the class effect is random trt sample trt trt CRD and Random Effects Example 2 Note the difference in the objectives 1 A A A A A B B B B B C C C C C D D D D 20 D Statistics 572 Spring 2007 Compare the average reading skill of students in 8 specific second grade classes in Madison Take a random sample of 10 students from each class and measure their reading skills March 8 2007 11 11 Statistics 572 Spring 2007 CRD and Random Effects March 8 2007 10 11
View Full Document