# MATH 6643 Summer 2012 Applications of Mixed Models/Submitted sample exam questions

### From Wiki1

(→Ryan's Questions) |
|||

Line 104: | Line 104: | ||

In Chapter 11 Snijders & Bosker discuss the problem of optimal sample size in order to obtain accurate estimates of the ICC. Explain the reasoning behind the process of optimization for the hierarchical sample (assuming equal cluster sizes with a sample of size ''M'' with ''N'' clusters of size ''n''). | In Chapter 11 Snijders & Bosker discuss the problem of optimal sample size in order to obtain accurate estimates of the ICC. Explain the reasoning behind the process of optimization for the hierarchical sample (assuming equal cluster sizes with a sample of size ''M'' with ''N'' clusters of size ''n''). | ||

+ | |||

+ | === Carrie's Questions === | ||

+ | '''Early Chapters/Course Content:''' | ||

+ | |||

+ | |||

+ | '''Later Chapters/Course Content:''' | ||

+ | Data is obtained from on the effects of two treatments (A and B). Data was recorded on symptoms weekly throughout 12 weeks of active treatment and then for 8 more weeks following termination of the treatment. A linear spline model is fit to the data and the following results were obtained: | ||

+ | :: | ||

+ | <pre> | ||

+ | > fit <- lme( Symptom ~ sp(Weeks)*tx, random=~1+Weeks|id, data = d) | ||

+ | > summary(fit) | ||

+ | Linear mixed-effects model fit by REML | ||

+ | Data: d | ||

+ | AIC BIC logLik | ||

+ | 15099.44 15153.18 -7539.719 | ||

+ | |||

+ | Random effects: | ||

+ | Formula: ~1 + Weeks | id | ||

+ | Structure: General positive-definite, Log-Cholesky parametrization | ||

+ | StdDev Corr | ||

+ | (Intercept) 37.921194 (Intr) | ||

+ | Weeks 2.395329 -0.218 | ||

+ | Residual 23.285420 | ||

+ | |||

+ | Fixed effects: Symptom ~ sp(Weeks) * tx | ||

+ | Value Std.Error DF t-value p-value | ||

+ | (Intercept) 131.84484 6.450470 1516 20.43957 0.0000 | ||

+ | sp(Weeks)D1(0) -11.21889 0.508022 1516 -22.08346 0.0000 | ||

+ | sp(Weeks)C(10).1 18.24584 0.571104 1516 31.94835 0.0000 | ||

+ | txB -2.61621 9.122343 78 -0.28679 0.7750 | ||

+ | sp(Weeks)D1(0):txB 1.55017 0.718452 1516 2.15765 0.0311 | ||

+ | sp(Weeks)C(10).1:txB -4.83791 0.807664 1516 -5.99001 0.0000 | ||

+ | Correlation: | ||

+ | (Intr) sp(W)D1(0) sp(W)C(10).1 txB s(W)D1(0): | ||

+ | sp(Weeks)D1(0) -0.371 | ||

+ | sp(Weeks)C(10).1 0.256 -0.604 | ||

+ | txB -0.707 0.262 -0.181 | ||

+ | sp(Weeks)D1(0):txB 0.262 -0.707 0.427 -0.371 | ||

+ | sp(Weeks)C(10).1:txB -0.181 0.427 -0.707 0.256 -0.604 | ||

+ | |||

+ | Standardized Within-Group Residuals: | ||

+ | Min Q1 Med Q3 Max | ||

+ | -4.109811205 -0.593593851 -0.002546668 0.654503092 3.122385555 | ||

+ | |||

+ | Number of Observations: 1600 | ||

+ | Number of Groups: 80 | ||

+ | </pre> | ||

+ | |||

+ | :* Interpret the coefficients in the model. | ||

+ | :* Sketch the predicted trajectories. | ||

+ | :* Bonus: How would you test whether there is a significant difference in the predicted symptom score at week 10 or week 18? |

## Revision as of 22:38, 16 July 2012

**Question 1:**

Consider the following output:

> head(hs) school mathach ses Sex Minority Size Sector PRACAD DISCLIM 1 1317 12.862 0.882 Female No 455 Catholic 0.95 -1.694 2 1317 8.961 0.932 Female Yes 455 Catholic 0.95 -1.694 3 1317 4.756 -0.158 Female Yes 455 Catholic 0.95 -1.694 4 1317 21.405 0.362 Female Yes 455 Catholic 0.95 -1.694 5 1317 20.748 1.372 Female No 455 Catholic 0.95 -1.694 6 1317 18.362 0.132 Female Yes 455 Catholic 0.95 -1.694 > fit <- lme( mathach ~ ses * cvar(ses,school), hs, + random = ~ 1 + ses|school) > summary(fit) Linear mixed-effects model fit by REML Data: hs AIC BIC logLik 12846.85 12891.54 -6415.423 Random effects: Formula: ~1 + ses | school Structure: General positive-definite, Log-Cholesky parametrization StdDev Corr (Intercept) 1.6293867 (Intr) ses 0.6614903 -0.469 Residual 6.1109156 Fixed effects: mathach ~ ses * cvar(ses, school) Value Std.Error DF t-value p-value (Intercept) 12.681917 0.3054760 1935 41.51526 0.0000 ses 2.243374 0.2416545 1935 9.28339 0.0000 cvar(ses, school) 3.687892 0.7699000 38 4.79009 0.0000 ses:cvar(ses, school) 0.873953 0.5771829 1935 1.51417 0.1301 Correlation: (Intr) ses cv(,s) ses -0.188 cvar(ses, school) 0.022 -0.261 ses:cvar(ses, school) -0.258 0.065 0.014 Standardized Within-Group Residuals: Min Q1 Med Q3 Max -3.2291287 -0.7433282 0.0306118 0.7770370 2.6906899 Number of Observations: 1977 Number of Groups: 40

- Identify the expression of the model in mathematical formula and the usual model assumption.
- Find out the variances of the group effects, residuals and the response.
- Sketch the estimated response function for a school with mean ses of 0.
- For what value of ses is the variance of mathach estimated to be minimized.

**Question 2:**

Longitudinal data analysis with mixed models: Consider a mixed model with random intercept and slope with respect to time, T. Suppose that the G matrix is

- Find the value of T for which the variance of Y is minimized and the minimum variance.
- Show that recentering T on this value (if known) turns the G matrix into one with only two free parameters.
- Sketch a data plot to show the location and value of the minimum standard deviation of lines.

**Question 3:**

Explain why would would want to add or *S**D*_{j} to a multilevel model.

**Question 4:**

Discuss the interpretation/ramifications of extreme ICC values in the design of a multilevel study.

**Question 5:**

Explain the similarities and differences between within effects, between effects and clusters.

**Question 5:**

Discuss/explain the relationship between longitudinal data and hierarchical data with appropriate examples and theory.

**Question 6:**

Let Σ be symmetric. Show that Σ is positive-definite if and only there exists a non-singular matrix A such that Σ = AA'

**Question 7:**

Why do we study longitudinal and mixed models?

### Ryan's Questions

**Early Chapters/Course Content:**

What is Simpson's Paradox and how is it related to HLM? - Please describe the necessary relationships and sketch them accordingly.

Under what two conditions might someone be completely unconcerned with the possible problems associated with this paradox?

**Later Chapters/Course Content:**

In Chapter 11 Snijders & Bosker discuss the problem of optimal sample size in order to obtain accurate estimates of the ICC. Explain the reasoning behind the process of optimization for the hierarchical sample (assuming equal cluster sizes with a sample of size *M* with *N* clusters of size *n*).

### Carrie's Questions

**Early Chapters/Course Content:**

**Later Chapters/Course Content:**
Data is obtained from on the effects of two treatments (A and B). Data was recorded on symptoms weekly throughout 12 weeks of active treatment and then for 8 more weeks following termination of the treatment. A linear spline model is fit to the data and the following results were obtained:

> fit <- lme( Symptom ~ sp(Weeks)*tx, random=~1+Weeks|id, data = d) > summary(fit) Linear mixed-effects model fit by REML Data: d AIC BIC logLik 15099.44 15153.18 -7539.719 Random effects: Formula: ~1 + Weeks | id Structure: General positive-definite, Log-Cholesky parametrization StdDev Corr (Intercept) 37.921194 (Intr) Weeks 2.395329 -0.218 Residual 23.285420 Fixed effects: Symptom ~ sp(Weeks) * tx Value Std.Error DF t-value p-value (Intercept) 131.84484 6.450470 1516 20.43957 0.0000 sp(Weeks)D1(0) -11.21889 0.508022 1516 -22.08346 0.0000 sp(Weeks)C(10).1 18.24584 0.571104 1516 31.94835 0.0000 txB -2.61621 9.122343 78 -0.28679 0.7750 sp(Weeks)D1(0):txB 1.55017 0.718452 1516 2.15765 0.0311 sp(Weeks)C(10).1:txB -4.83791 0.807664 1516 -5.99001 0.0000 Correlation: (Intr) sp(W)D1(0) sp(W)C(10).1 txB s(W)D1(0): sp(Weeks)D1(0) -0.371 sp(Weeks)C(10).1 0.256 -0.604 txB -0.707 0.262 -0.181 sp(Weeks)D1(0):txB 0.262 -0.707 0.427 -0.371 sp(Weeks)C(10).1:txB -0.181 0.427 -0.707 0.256 -0.604 Standardized Within-Group Residuals: Min Q1 Med Q3 Max -4.109811205 -0.593593851 -0.002546668 0.654503092 3.122385555 Number of Observations: 1600 Number of Groups: 80

- Interpret the coefficients in the model.
- Sketch the predicted trajectories.
- Bonus: How would you test whether there is a significant difference in the predicted symptom score at week 10 or week 18?