Session Ready
Exercise

Calculating and extracting variance

You are assuming that the variation around the intercept is randomly influenced by site, and the degree to which it is influenced is normally distributed with a variance of d. Use two different methods to find the estimate of variance, first by calculating it manually, and then by extracting it using VarCorr().

The output of random_int_model is:

Linear mixed-effects model fit by REML
  Data: orchids 
  Log-restricted-likelihood: -420.2667
  Fixed: abundance ~ humidity 
(Intercept)    humidity 
 -4.3751595   0.1785742 

Random effects:
 Formula: ~1 | site
        (Intercept) Residual
StdDev:    3.515514 3.066667

Number of Observations: 160
Number of Groups: 8

Note that the orchids data set, random_int_model model, and nlme library have been preloaded.

Instructions
100 XP
  • Calculate the estimate of variance for the random intercept of random_int_model by examining values in the model output.
  • Extract the estimate of variance using VarCorr().