Learn R Programming

SASmixed (version 0.1-7)

Multilocation: A multilocation trial

Description

The Multilocation data frame has 108 rows and 7 columns.

Arguments

source

Littel, R. C., Milliken, G. A., Stroup, W. W., and Wolfinger, R. D. (1996), SAS System for Mixed Models, SAS Institute (Data Set 2.8.1).

Examples

Run this code
options(
  contrasts = c(unordered = "contr.SAS", ordered = "contr.poly"))
data(Multilocation)
formula( Multilocation )
names( Multilocation )
### Create a Block %in% Location factor
Multilocation$Grp <-
  getGroups( Multilocation, form = ~ Location/Block, level = 2 )
fm1Mult <- lme( Adj ~ Location * Trt, data = Multilocation, ~ 1 | Grp)
summary( fm1Mult )
VarCorr( fm1Mult )
anova( fm1Mult )
fm2Mult <- update( fm1Mult, Adj ~ Location + Trt )
fm3Mult <- update( fm1Mult, Adj ~ Location )
fm4Mult <- update( fm1Mult, Adj ~ Trt )
fm5Mult <- update( fm1Mult, Adj ~ 1 )
summary( fm2Mult )
VarCorr( fm2Mult )
anova( fm2Mult )
### Treating the location as a random effect
fm1MultR <- lme( Adj ~ Trt, data = Multilocation,
  random = list( Location = pdCompSymm( ~ Trt - 1 ), Block = ~ 1 ) )
summary( fm1MultR )
intervals( fm1MultR )
VarCorr( fm1MultR )
anova( fm1MultR )
fm2MultR <-
  update( fm1MultR, random = list( Location = ~ Trt - 1, Block = ~ 1 ))
anova( fm1MultR, fm2MultR )

Run the code above in your browser using DataLab