Presentation is loading. Please wait.

Presentation is loading. Please wait.

G89.2247 Lecture 71 Revisiting Hierarchical Mixed Models A General Version of the Model Variance/Covariances of Two Kinds of Random Effects Parameter Estimation.

Similar presentations


Presentation on theme: "G89.2247 Lecture 71 Revisiting Hierarchical Mixed Models A General Version of the Model Variance/Covariances of Two Kinds of Random Effects Parameter Estimation."— Presentation transcript:

1 G89.2247 Lecture 71 Revisiting Hierarchical Mixed Models A General Version of the Model Variance/Covariances of Two Kinds of Random Effects Parameter Estimation Details Examples of Alternative Models

2 G89.2247 Lecture 72 Revisiting the Hierarchical Mixed Models Last week we considered a two level model for the j th person at the i th time. Let Y be some outcome, X some time-dependent process (such as measure of time) and D be some between-person variable.  LEVEL 1: Y ij =  0j +  1j X ij + r ij  LEVEL 2  0j =  00 +  01 D j + U 0j  1j =  10 +  11 D j + U 1j The combined model is  Y ij =  00 +  10 X ij +  01 D j +  11 (X ij *D j )+U 0j +U 1j X ij +r ij

3 G89.2247 Lecture 73 Two Kinds of Random Effects U 0j and U 1j are assumed to be normally distributed with mean zero and covariance matrix Last week we assumed that r ij was iid Normal with mean zero and variance    We assumed that the Level 1 model accounted for within- person dependency of scores.

4 G89.2247 Lecture 74 A More General Model We don't have to assume that the r ij terms are uncorrelated within person. Suppose we write a vector of within person variables over n time points as where Y j is the n  1 list of outcomes, W j is the n  4 array of codes for the fixed effects, and Z j is the array of codes for the random effects. The fixed effect coefficients are collected in the vector , and the random effect coefficients are collected in U j. The residuals are in a list r j.

5 G89.2247 Lecture 75 A Numerical Example Suppose that we have a person from group 0 measures at times 0,1,2 with scores for Y, 2.329, 3.449, and 3.943. We write

6 G89.2247 Lecture 76 More on the General Model W j contains constants that say which of the fixed effect constants (  ) apply to Y j Z j contains information relating the random effects (U j ) to the set of Y ij values in Y j r j contains the residuals from the within-person linear fit. Var(U j ) = T Var(r j ) = R Var(Y j ) = [Z j TZ T j + R] = V

7 G89.2247 Lecture 77 Thinking about Var(r j ) = R The matrix R is the expected covariance among the residuals, after taking into account the fixed effects (  ) and the random regression effects (U j ).  If the residuals are uncorrelated with common variance R =   I (a diagonal matrix) This was implicitly assumed so far.  Other structures for R can be considered, such as autoregressive, AR(1), or moving average, MA(1)

8 G89.2247 Lecture 78 The General Model: Sample Level Suppose we string the Y j vectors together:

9 G89.2247 Lecture 79 A Numerical Example  ---W----  --------------Z------------------  Y

10 G89.2247 Lecture 710 Estimation Using General Framework If the observations were all independent, the general equation would be and the OLS estimates of the fixed regression effectes,  would be

11 G89.2247 Lecture 711 Estimation Using General Framework In the general case, the estimates of the fixed effects need to take into account both the random effects and the correlated residuals. If the matrices T and R were known, we would have where Var(Y j ) = [Z j TZ T j + R] = V

12 G89.2247 Lecture 712 Interative Solution in General Case PROC MIXED  1) estimates the fixed effects using ordinary least squares  2) estimates T and R using ML or REML on residuals  3) estimates fixed effects using weighted least squares  4) re-estimates T and R using ML/REML and so on

13 G89.2247 Lecture 713 Theory and Practice In theory we can estimate both Var(U)=T and Var(r)=R In practice, the estimates need to be structured. Consider two patterns for R

14 G89.2247 Lecture 714 Simulated Data Example

15 G89.2247 Lecture 715 PROC MIXED Syntax filename myimport 'c:\mixedex.por'; proc convert spss=myimport out=sasuser.mixedex; TITLE1 'SMALL SIMULATED RANDOM COEFFICIENTS DATA'; run; proc mixed covtest; class sub; model y=g time g*time /s; random intercept / subject=sub g gcorr type=un; REPEATED /TYPE=AR(1) SUBJECT=SUB R RCORR; TITLE2 'RANDOM INTERCEPT/SLOPE W CORRELATED RESIDUALS'; run;

16 G89.2247 Lecture 716 Bar Anxiety Study: Estimating R as AR(1) To Estimate R, we include a REPEATED statement in PROC MIXED PROC MIXED NOCLPRINT COVTEST METHOD=REML; CLASS id; MODEL anx=group week group*week /s; RANDOM intercept week /SUBJECT=id type=un gcorr; REPEATED /TYPE=AR(1) SUBJECT=ID R RCORR; TITLE2 '2RANDOMEFFECTS: ASSUMES RESIDUALS HAVE AR(1) CORR PATTERN';

17 G89.2247 Lecture 717 Iteration Results Iteration History Iteration Evaluations -2 Res Log Like Criterion 0 1 1181.57562114 1 4 766.08071731 0.02700202 2 2 764.50981326 0.00397933 3 1 764.02144473 0.00016482 4 1 764.00270777 0.00000033 5 1 764.00267161 0.00000000 Convergence criteria met.

18 G89.2247 Lecture 718 Random Effect Estimates Estimated R Correlation Matrix for id 1 Row Col1 Col2 Col3 Col4 1 1.0000 0.4860 0.2362 0.1148 2 0.4860 1.0000 0.4860 0.2362 3 0.2362 0.4860 1.0000 0.4860 4 0.1148 0.2362 0.4860 1.0000 Estimated G Correlation Matrix Row Effect id Col1 Col2 1 Intercept 1 1.0000 1.0000 2 week 1 1.0000 1.0000

19 G89.2247 Lecture 719 Random Effects Continued Covariance Parameter Estimates Standard Z Cov Parm Subject Estimate Error Value Pr Z UN(1,1) id 0.1860 0.06132 3.03 0.0012 UN(2,1) id 0.03711 0.01159 3.20 0.0014 UN(2,2) id 1.06E-18... AR(1) id 0.4860 0.09316 5.22 <.0001 Residual 0.2091 0.03689 5.67 <.0001

20 G89.2247 Lecture 720 Fixed Effects for AR(1) Model Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept 1.1547 0.07482 133 15.43 <.0001 group -0.6028 0.1062 270 -5.68 <.0001 week 0.2642 0.02453 133 10.77 <.0001 group*week -0.2859 0.03482 270 -8.21 <.0001

21 G89.2247 Lecture 721 Compare to Model Assuming R=I Fixed Effects are quite similar

22 G89.2247 Lecture 722 Comparing Alternative Models Two tools are useful  AIC: Akaike's Information Criterion Based on the log likelihood, but adjusts for number of parameters that are estimated (the large the number of estimates, the smaller the log likelihood) Can be compared across REML runs Closer to zero is better  -2*Log Likelihood comparisons Useful for nested models Should be estimated using ML rather than REML

23 G89.2247 Lecture 723 Example: R=I vs R=AR(1) Original analysis that assumed that R=I  AIC from REML analysis = 784  -2LL from ML = 758.1 New analysis with R estimated with AR(1)  AIC from REML analysis = 772  -2LL from ML = 752.5 One new parameter estimate reduced –2LL by 758.1-752.5 = 5.6. Chi Square on 1df is significant.  AR(1) appears to be better model in terms of fit Random effect for slope goes away! Fixed effect results are very similar


Download ppt "G89.2247 Lecture 71 Revisiting Hierarchical Mixed Models A General Version of the Model Variance/Covariances of Two Kinds of Random Effects Parameter Estimation."

Similar presentations


Ads by Google