Mississippi: Nitrogen concentrations in the Mississippi River

Description Format Source Examples

Description

The Mississippi data frame has 37 rows and 3 columns.

Format

This data frame contains the following columns:

influent

an ordered factor with levels 3 < 5 < 2 < 1 < 4 < 6

y

a numeric vector

Type

a factor with levels 1 2 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 4.2).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
str(Mississippi)
if (require("lattice", quietly = TRUE, character = TRUE)) {
  dotplot(drop(influent:Type) ~ y, groups = Type, Mississippi)
} 
if (require("lme4", quietly = TRUE, character = TRUE)) {
  options(contrasts = c(unordered = "contr.SAS", ordered = "contr.poly"))
  ## compare with output 4.1, p. 142
  print(fm1Miss <- lmer(y ~ 1 + (1|influent), Mississippi))
  ## compare with output 4.2, p. 143
  print(fm1MLMiss <- update(fm1Miss, REML=FALSE))
  ## BLUP's of random effects on p. 142
  ranef(fm1Miss)            
  ## BLUP's of random effects on p. 144
  print(ranef(fm1MLMiss))
#intervals(fm1Miss)       # interval estimates of variance components
  ## compare to output 4.8 and 4.9, pp. 150-152
  print(fm2Miss <- lmer(y ~ Type+(1|influent), Mississippi, REML=TRUE))
  print(anova(fm2Miss))
}

Example output

'data.frame':	37 obs. of  3 variables:
 $ influent: Factor w/ 6 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 2 ...
 $ y       : num  21 27 29 17 19 12 29 20 20 21 ...
 $ Type    : Factor w/ 3 levels "1","2","3": 2 2 2 2 2 2 2 2 2 2 ...
 - attr(*, "ginfo")=List of 7
  ..$ formula     :Class 'formula'  language y ~ 1 | influent
  .. .. ..- attr(*, ".Environment")=<environment: R_GlobalEnv> 
  ..$ order.groups: logi TRUE
  ..$ FUN         :function (x)  
  ..$ outer       :Class 'formula'  language ~Type
  .. .. ..- attr(*, ".Environment")=<environment: R_GlobalEnv> 
  ..$ inner       : NULL
  ..$ labels      :List of 1
  .. ..$ y: chr "Nitrogen concentration in Mississippi River"
  ..$ units       :List of 1
  .. ..$ y: chr "(ppm)"
Linear mixed model fit by REML ['lmerMod']
Formula: y ~ 1 + (1 | influent)
   Data: Mississippi
REML criterion at convergence: 252.3511
Random effects:
 Groups   Name        Std.Dev.
 influent (Intercept) 7.958   
 Residual             6.531   
Number of obs: 37, groups:  influent, 6
Fixed Effects:
(Intercept)  
      21.22  
Linear mixed model fit by maximum likelihood  ['lmerMod']
Formula: y ~ 1 + (1 | influent)
   Data: Mississippi
      AIC       BIC    logLik  deviance  df.resid 
 262.5570  267.3898 -128.2785  256.5570        34 
Random effects:
 Groups   Name        Std.Dev.
 influent (Intercept) 7.159   
 Residual             6.534   
Number of obs: 37, groups:  influent, 6
Fixed Effects:
(Intercept)  
      21.22  
$influent
  (Intercept)
1   0.3097833
2  -6.5772278
3  -3.7862748
4   2.8826711
5  -5.8435210
6  13.0145691

Linear mixed model fit by REML ['lmerMod']
Formula: y ~ Type + (1 | influent)
   Data: Mississippi
REML criterion at convergence: 234.5246
Random effects:
 Groups   Name        Std.Dev.
 influent (Intercept) 3.869   
 Residual             6.520   
Number of obs: 37, groups:  influent, 6
Fixed Effects:
(Intercept)        Type1        Type2  
      36.40       -20.80       -16.46  
Analysis of Variance Table
     Df Sum Sq Mean Sq F value
Type  2 541.76  270.88  6.3716

SASmixed documentation built on May 2, 2019, 4:47 p.m.