Extra exercises for VHM 881: Statistical Analysis of Generalized, Linear, and Mixed Models -
Fall Semester 2004
- Example 3.1:
Analyze the data from Figure 3.1 in MS (with data values read off the figure) by a linear regression
model and by a generalised linear model (in both cases ignoring the weeks),
and by a linear mixed model taking the weeks into account.
- Example 4.7:
Go through the calculations of Section 4.7 using the R software.
- Extra for Chapter 6 of VR:
For the Whiteside data, fit simple linear regressions and check the
normality of standardized residuals using Shapiro-Wilks test
(shapiro.test). By simulation, compute a P-value that takes into
account the dependence between residuals. Use n=1000
simulated datasets with normal errors. (solution)
- Extra for Chapter 2 of PB:
Consider the textbook example of simulation for testing fm1Machine against
fm2Machine, and restrict attention to ML estimation.
- Choose a seed, and run 1000 simulations. Extract the two sets
of logL values from the object, and compute the value of -2logL for
each of the 1000 simulations. (Hint: read carefully the description
of the simulation.lme object in the nlme help pages.)
- Carry out a descriptive analysis of those simulated values. Do all the
values seem reasonable? - if not, try to give an explanation. Compute the
proportion of values equal to zero, and interpret that value.
- Sort the -2logL values, and compare them by a plot to the
percentiles of a chi-square(1) distribution. What does the plot
show? Then make the comparison on probability scale, by plotting
the cumulative distribution function of the chi-square(1) against the
-2logL values. Make a final adjustment to achieve the same plot as in
Figure 2.4.
- Repeat the steps of 3. for a reference distribution which is a
0.5:0.5 mixture of chi-squares (0) and (1).
(solution)
- Extra for Chapter 10 of VR:
Analyse the bacteria dataset in the MASS library by a random
effects generalised linear model using the following methods:
- glmmPQL function in the MASS library
- glmmML user-contributed package
Study the documentation to determine which estimation procedure
is used. Export the dataset to Stata and run the same model using
the gllamm macro.
Other options in R are a glmmGIBBS package not currently listed
at CRAN but apparently it has been in the past, and packages
developed by Jim Lindsey, accessible from
http://popgen0146uns50.unimaas.nl/~jlindsey/rcode.html.
Henrik Stryhn
(hstryhn@upei.ca) 2004-12-30