Learn R Programming

SASmixed (version 1.0-4)

Multilocation: A multilocation trial

Description

The Multilocation data frame has 108 rows and 7 columns.

Arguments

Format

This data frame contains the following columns:
obs
a numeric vector
Location
an ordered factor with levels B < D < E < I < G < A < C < F < H
Block
a factor with levels 1 to 3
Trt
a factor with levels 1 to 4
Adj
a numeric vector
Fe
a numeric vector
Grp
an ordered factor with levels B/1 < B/2 < B/3 < D/1 < D/2 < D/3 < E/1 < E/2 < E/3 < I/1 < I/2 < I/3 < G/1 < G/2 < G/3 < A/1 < A/2 < A/3 < C/1 < C/2 < C/3 < F/1 < F/2 < F/3 < H/1 < H/2 < H/3

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

str(Multilocation)
if (require("lme4", quietly = TRUE, character = TRUE)) {
  options(contrasts = c(unordered = "contr.SAS", ordered = "contr.poly"))
  ### Create a Block %in% Location factor
  Multilocation$Grp <- with(Multilocation, Block:Location)
  print(fm1Mult <- lmer(Adj ~ Location * Trt + (1|Grp), Multilocation))
  print(anova(fm1Mult))
  print(fm2Mult <- lmer(Adj ~ Location + Trt + (1|Grp), Multilocation), corr=FALSE)
  print(fm3Mult <- lmer(Adj ~ Location + (1|Grp), Multilocation), corr=FALSE)
  print(fm4Mult <- lmer(Adj ~ Trt + (1|Grp), Multilocation))
  print(fm5Mult <- lmer(Adj ~ 1 + (1|Grp), Multilocation))
  print(anova(fm2Mult))
  print(anova(fm1Mult, fm2Mult, fm3Mult, fm4Mult, fm5Mult))
  ### Treating the location as a random effect
  print(fm1MultR <- lmer(Adj ~ Trt + (1|Location/Trt) + (1|Grp), Multilocation))
  print(anova(fm1MultR))
  fm2MultR <- lmer(Adj ~ Trt + (Trt - 1|Location) + (1|Block), Multilocation)
  ## Warning (not error ?!): Convergence failure in 10000 iter %% __FIXME__
  print(fm2MultR)# does not mention previous conv.failure %% FIXME ??
  print(anova(fm1MultR, fm2MultR))
 ## Not run: 
#   confint(fm1MultR)
#  ## End(Not run)
}

Run the code above in your browser using DataLab