1 / 31

Mixed Model (LME)

Mixed Model (LME). pH vs. CO 2 in Eyes. Structure of data. 18 subjects 2 visits per subject Two measurements per visit (one per eye). The levels of CO 2 were randomly assigned to the 4 measurements. Data. id co2 ph prph visit eye 1 1 0 7.432 76.4 1 1

sancha
Download Presentation

Mixed Model (LME)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mixed Model (LME) pH vs. CO2 in Eyes

  2. Structure of data • 18 subjects • 2 visits per subject • Two measurements per visit (one per eye). • The levels of CO2 were randomly assigned to the 4 measurements.

  3. Data id co2 ph prph visit eye 1 1 0 7.432 76.4 1 1 2 1 5 6.956 59.4 1 2 3 1 3 7.232 80.3 2 1 4 1 7 6.982 74.2 2 2 5 2 0 7.594 67.8 1 1 6 2 7 6.929 61.1 1 2 7 2 3 7.230 73.4 2 1 8 2 5 7.073 65.9 2 2 9 3 3 7.329 87.6 1 1 10 3 7 6.963 55.8 1 2

  4. Look at Data

  5. Model 1 - OLS • First model is as follows: for the ith individual, the jth visit, kth eye. • Xijk =CO2 • How does one interpret the parameters, 0, 1, and 2?

  6. Model 1, cont. • E(eijk)=0, cov(eijk, eij’k’)=0, jj’ or kk. • Var(eijk)= 2e . • What does V0 look like for this model?

  7. Model 1 using SAS ********************************************************; * PROC MIXED, Model 1; ********************************************************; procmixeddata=rep2001.phlong; class id; model ph = co2 co22 / s; estimate'3' co2 3 co22 9 / cl; estimate'5' co2 5 co22 25 / cl; estimate'7' co2 7 co22 49 / cl; run;

  8. Model 1 Results using SAS Covariance Parameter Estimates Cov Parm Estimate Residual 0.007792 Fit Statistics -2 Res Log Likelihood -117.1 AIC (smaller is better) -115.1 AICC (smaller is better) -115.0 BIC (smaller is better) -112.9 Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept 7.6462 0.02119 67 360.81 <.0001 CO2 -0.1373 0.01379 67 -9.96 <.0001 CO22 0.007339 0.001910 67 3.84 0.0003

  9. Model 1- Estimate Command Results Estimates Standard Label Estimate Error DF t Value Pr > |t| Alpha Lower Upper 3 -0.3458 0.02549 67 -13.57 <.0001 0.05 -0.3967 -0.2949 5 -0.5028 0.02733 67 -18.40 <.0001 0.05 -0.5574 -0.4483 7 -0.6011 0.02865 67 -20.98 <.0001 0.05 -0.6583 -0.5439

  10. Model 2 • How does one interpret the parameters, 0, 0i, and 1, 2?

  11. Model 2, cont. • E(eijk)=0, cov(eijk, eij’k’)=0, jj’ or kk’ • Var(eijk)= 2e • Var(0i)= 2id. • cov(eijk, 0i)= 0. • What does V0 look like for this model?

  12. Model 2 using SAS ********************************************************; * PROC MIXED, Model 2; ********************************************************; procmixeddata=rep2001.phlong; class id; model ph = co2 co22 / s; random int / sub=id; estimate'3' co2 3 co22 9 / cl; estimate'5' co2 5 co22 25 / cl; estimate'7' co2 7 co22 49 / cl; run;

  13. Model 2 Results using SAS Covariance Parameter Estimates Cov Parm Subject Estimate Intercept ID 0.005052 Residual 0.002696 Fit Statistics -2 Res Log Likelihood -152.4 AIC (smaller is better) -148.4 AICC (smaller is better) -148.2 BIC (smaller is better) -146.6 Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept 7.6458 0.02098 17 364.50 <.0001 CO2 -0.1373 0.008115 50 -16.92 <.0001 CO22 0.007344 0.001123 50 6.54 <.0001

  14. Model 2- Estimate Command Results Estimates Standard Label Estimate Error DF t Value Pr > |t| Alpha Lower Upper 3 -0.3456 0.01484 50 -23.28 <.0001 0.05 -0.3755 -0.3158 5 -0.5025 0.01596 50 -31.50 <.0001 0.05 -0.5346 -0.4705 7 -0.6006 0.01681 50 -35.72 <.0001 0.05 -0.6343 -0.5668

  15. Model 3 • How does one interpret the parameters, 0, 0i, 0i jand 1, 2?

  16. Model 3, cont. • E(eijk)=0, cov(eijk, eij’k’)=0, jj’ or kk’ • Var(eijk)= 2e • Var(0i)= 2id • Var(0ij)= 2visit • cov(eijk, 0i)= 0, cov(eijk, 0ij)= 0, cov(0i, 0ij)= 0 • What does V0 look like for this model?

  17. Model 3 using SAS ********************************************************; * PROC MIXED, Model 3; ********************************************************; procmixeddata=rep2001.phlong; class id visit; model ph = co2 co22 / s; random id visit(id); estimate'3' co2 3 co22 9 / cl; estimate'5' co2 5 co22 25 / cl; estimate'7' co2 7 co22 49 / cl; run;

  18. Model 3 Results using SAS Covariance Parameter Estimates Cov Parm Estimate ID 0.004928 VISIT(ID) 0.000395 Residual 0.002433 Fit Statistics -2 Res Log Likelihood -152.8 AIC (smaller is better) -146.8 AICC (smaller is better) -146.5 BIC (smaller is better) -144.2 Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept 7.6446 0.02092 17 365.50 <.0001 CO2 -0.1365 0.008061 33 -16.94 <.0001 CO22 0.007262 0.001115 33 6.51 <.0001

  19. Model 3- Estimate Command Results Estimates Standard Label Estimate Error DF t Value Pr > |t| Alpha Lower Upper 3 -0.3440 0.01471 33 -23.39 <.0001 0.05 -0.3739 -0.3141 5 -0.5007 0.01575 33 -31.79 <.0001 0.05 -0.5327 -0.4686 7 -0.5992 0.01642 33 -36.49 <.0001 0.05 -0.6326 -0.5658

  20. Model 4 • How does one interpret the parameters, 0, 0i, 1i,2i and 1, 2?

  21. Model 4, cont. • E(eijk)=0, cov(eijk, eij’k’)=0, jj’ or kk’ • Var(eijk)= 2e • Var(0i)= 20, Var(1i)= 21, Var(2i)= 22 • cov(eijk, 0i)= 0, cov(eijk, 1i)= 0, cov(eijk, 2i)= 0. • cov(0i, 1i)= 01, cov(0i, 2i)= 02, cov(1i, 2i)= 12. • What does variance-covariance of random effects look like?

  22. Model 4 using SAS ********************************************************; * PROC MIXED, Model 4; ********************************************************; procmixeddata=rep2001.phlong; class id visit; model ph = co2 co22 / s; random int co2 co22 /sub=id; estimate'3' co2 3 co22 9 / cl; estimate'5' co2 5 co22 25 / cl; estimate'7' co2 7 co22 49 / cl; run;

  23. Model 4 Results using SAS Covariance Parameter Estimates Cov Parm Subject Estimate Intercept ID 0.005054 CO2 ID 0 CO22 ID 0 Residual 0.002696 Fit Statistics -2 Res Log Likelihood -152.4 AIC (smaller is better) -148.4 AICC (smaller is better) -148.2 BIC (smaller is better) -146.6 Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept 7.6458 0.02098 17 364.47 <.0001 CO2 -0.1373 0.008114 17 -16.92 <.0001 CO22 0.007344 0.001123 16 6.54 <.0001

  24. Model 4 - Estimate Command Results Estimates Standard Label Estimate Error DF t Value Pr > |t| Alpha Lower Upper 3 -0.3456 0.01484 16 -23.29 <.0001 0.05 -0.3771 -0.3142 5 -0.5025 0.01595 16 -31.50 <.0001 0.05 -0.5363 -0.4687 7 -0.6006 0.01681 16 -35.72 <.0001 0.05 -0.6362 -0.5649

  25. Comparing Models

  26. Splus Appendix

  27. Model 1 using lm (OLS) > lm.ph.model1<-lm(ph~co2+co2^2,data=phc02long,na.action=na.omit) > summary(lm.ph.model1) Coefficients: Value Std. Error t value Pr(>|t|) (Intercept) 7.6462 0.0212 360.8133 0.0000 0 co2 -0.1373 0.0138 -9.9555 0.0000 1 I(co2^2) 0.0073 0.0019 3.8432 0.0003 2 Residual standard error: 0.08827 on 67 degrees of freedom e

  28. Model 2 using lme > lme.ph.model2<-lme(ph~co2+co2^2,random=~1 | id, data=phc02long, na.action=na.omit) > summary(lme.ph.model2) Linear mixed-effects model fit by REML Data: phc02long AIC BIC logLik -142.3814 -131.3579 76.19069 ------------------------------------------------------------ Random effects: Formula: ~ 1 | id (Intercept) Residual StdDev: 0.0710906 0.05191807 id e ------------------------------------------------------------ Fixed effects: ph ~ co2 + co2^2 Value Std.Error DF t-value p-value (Intercept) 7.645778 0.02097791 50 364.4681 <.0001 0 co2 -0.137281 0.00811416 50 -16.9187 <.0001 1 I(co2^2) 0.007344 0.00112340 50 6.5373 <.0001 2 Interpretation?

  29. Model 3 using lme > lme.ph.model3<-lme(ph~co2+co2^2,random=~1 | id/visit, data=phc02long, + na.action=na.omit) > summary(lme.ph.model3) Linear mixed-effects model fit by REML Data: phc02long AIC BIC logLik -140.8394 -127.6112 76.41968 Random effects: Formula: ~ 1 | id (Intercept) StdDev: 0.07019805 id Formula: ~ 1 | visit %in% id (Intercept) Residual StdDev: 0.01988396 0.04932218 visite (Intercept) 7.644635 0.02091566 33 365.4981 <.0001 0 co2 -0.136527 0.00806119 33 -16.9363 <.0001 1 I(co2^2) 0.007262 0.00111502 33 6.5131 <.0001 2 ------------------------------------------------------------

  30. Model 3 - alternative syntax > lme.ph.model3.alt<-lme(ph~co2+co2^2,random=list(~1 | id,~1 | visit), data=phc02long,na.action=na.omit) > summary(lme.ph.model3.alt) Linear mixed-effects model fit by REML Data: phc02long AIC BIC logLik -140.8394 -127.6112 76.41968 Random effects: Formula: ~ 1 | id (Intercept) StdDev: 0.07019805 id Formula: ~ 1 | visit %in% id (Intercept) Residual StdDev: 0.01988396 0.04932218 visite (Intercept) 7.644635 0.02091566 33 365.4981 <.0001 0 co2 -0.136527 0.00806119 33 -16.9363 <.0001 1 I(co2^2) 0.007262 0.00111502 33 6.5131 <.0001 2 ------------------------------------------------------------

  31. Model 4 using lme > lme.ph.model4<-lme(ph~co2+co2^2,random=~1+co2+co2^2 | id,data=phc02long,na.action=na.omit) > summary(lme.ph.model4) Linear mixed-effects model fit by REML Data: phc02long AIC BIC logLik -140.2228 -118.1759 80.11142 ------------------------------------------------------------ Random effects: Formula: ~ 1 + co2 + co2^2 | id Structure: General positive-definite StdDev Corr (Intercept) 0.100906871 (Intr) co2 0 co2 0.013648260 -0.885 1 01 I(co2^2) 0.001191092 0.656 -0.932 2 02 12 Residual 0.047338794 e ------------------------------------------------------------ Fixed effects: ph ~ co2 + co2^2 Value Std.Error DF t-value p-value (Intercept) 7.645563 0.02653446 50 288.1372 <.0001 0 co2 -0.137186 0.00808829 50 -16.9611 <.0001 1 I(co2^2) 0.007335 0.00106247 50 6.9033 <.0001 2

More Related