Assignment #6 - Mixed effects models - 2019

For each of the following data sets, conduct the following analyses:

  1. Analyze the data using the standard lm (i.e., don't include any random effects). Report your results on the fixed effects using the standard sentence(s).
  2. Analyze the data again, but this time use lme (from the nlme package) to include random effects (random intercept). Again, report your results on the fixed effects using the standard sentence(s).
  3. Report what the standard deviation due the random effect is.
  4. Report how the results from the lm and lme differ

Note that the 'confint' function doesn't report the confidence limits in lme the same way it does for lm, so to calculate the confidence intervals, use 'intervals(results)' instead.

Data Set #1 - In this experiment, we have 8 fields, in each field we have three different plots, which are randomly assigned to 1 of 3 "treatments": control, fertilize, and burn (called dburn for reasons you should be able to figure out). Note that we can't test for an interaction between burn and fertilizer, because no plots received both treatments (so the treatments are different groups within a single variable; NOT different variables). The response variable being measured is density of grasshoppers (hoppers/hectare). Using the standard sentence(s), report the estimated difference in grasshopper density among all three treatments. This will require three sentences!

Data Set #2 - In this experiment, we have 8 fields and in each field we have four plots. In the plots, two levels of fertilizer (0 grams and 5 grams) are crossed in a fully factorial manner with two levels of hormone treatment (given hormone or not). So one plot receives neither fertilizer nor hormone, two plots receive one of each, and one plot receives both (this is called a fully factorial experiment). Thus, fertilizer and hormone are two separate fixed-effects variables (compared to Dataset #1). Our response is the average size of trees in each plot (cm). Note that the experimental design allows us to test for an interaction between the two variables; and you should do so! Report the results of the interactions, but remember that if the interaction isn't significant, to take it out of the model before reporting the main effects. Using the standard sentences, report the 'effect' of Fertilizer and Hormone.

Data Set #3 - In this dataset, we want to determine the growth trajectory of some species of tree from 10 years old to 20 years old. We repeatedly measure the size (height in meters) of 16 different individuals each year of the study and examine the relationship between age and size. In addition to running the fixed effects model, and the standard mixed model, I would also like you to run a model that incorporates a 'moving average' autocorrelation. Run an F-drop test to see if including the autocorrelation parameter significantly improves the fit of the model to the data. Report the results of this F-drop test. Also report the value of theta (the coefficient of autocorrelation) in your assignment, along with the standard deviation due to the random effect.

Truth