您好,欢迎访问三七文档
MixedeffectsmodelsforlongitudinaldataPeterSchlattmannLongitudinaldataMixedeffectsmodelsLongitudinaldataOrthodonticgrowthdata,ExamplefromPinheiroandBates(2000)InvestigatorsattheUniversityofNorthCarolinaDentalSchoolfollowedthegrowthof27children(16males,11females)fromage8untilage14.Everytwoyearstheymeasuredthedistancebetweenthepituitaryandthepterygomaxillaryfissure,twopointsthatareeasilyidentifiedonx-rayexposuresofthesideofthehead.library(nlme)plot(Orthodont)µ¶·¸LongitudinaldataMixedeffectsmodelsThedataOrthodontGroupedData:distance~age|SubjectdistanceageSubjectSex126.08M01Male225.010M01Male329.012M01Male431.014M01Male.............6521.08F01Female6620.010F01Female6721.512F01Female6823.014F01Femaleµ¶·¸LongitudinaldataMixedeffectsmodelsAge(yr)Distancefrompituitarytopterygomaxillaryfissure(mm)891113202530M16M05891113M02M11891113M07M08891113M03M12891113M13M14891113M09M15891113M06M04M01891113M10F10891113F09F06891113F01F05891113F07F02891113F08F03891113F04202530F11Figure1:Orthodonticgrowthdataµ¶·¸LongitudinaldataMixedeffectsmodelsQuestionsIsthereanageeffectongrowth?Isthereagenderdiference?Isgrowthdifferentinbothsexes(Isthereaninteraction)?Isafixedeffectsmodelappropriate?µ¶·¸LongitudinaldataMixedeffectsmodelsThesimplelinearregressionmodelWehaveMsubjectsandnimeasurementspersubjectyij=0+1x1ij+2x2ij+ij;i=1;:::;M;j=1;:::;niijN(0;2)Rcall:m0-glm(distance~Sex+age,data=Orthodont)µ¶·¸LongitudinaldataMixedeffectsmodelsResultCoefficients:EstimateStd.ErrortvaluePr(|t|)(Intercept)17.706711.1122115.9202e-16***SexFemale-2.321020.44489-5.2179.20e-07***age0.660190.097766.7538.25e-10***---Signif.codes:0`***'0.001`**'0.01`*'0.05`.'0.1`'1(Dispersionparameterforgaussianfamilytakentobe5.160679)Nulldeviance:917.69on107degreesoffreedomResidualdeviance:541.87on105degreesoffreedomAIC:488.68µ¶·¸LongitudinaldataMixedeffectsmodelsCommentBadfit!Notsurprising:weignoredcorrelationwithinsubjectsandvariabilitybetweensubjectsµ¶·¸LongitudinaldataMixedeffectsmodelsIndividualmodelsIdea:Computearegressionmodelforeachsubject!Restrictanalysistogirls(Individualgenderdifferencesarenonsense)Rcall:Orthof-Orthodont[Orthodont$Sex==Female,]m1-lmList(distance~age,data=Orthof)postscript(girlsci.eps)plot(intervals(m1))dev.off()µ¶·¸LongitudinaldataMixedeffectsmodelsSubject1520F10F09F06F01F05F07F02F08F03F04F11|||||||||||||||||||||||||||||||||(Intercept)0.00.51.0|||||||||||||||||||||||||||||||||ageFigure2:Comparisonof95%confidenceintervalsµ¶·¸LongitudinaldataMixedeffectsmodelsInterpretationWhatdoestheplotshow:Wehavebalanceddata,Confidenceintervalsareofsimilarwidths!Whatdoestheplotnotshow:Substantialvariabilitybetweensubjectsfortheinterceptsasexpectedbytheplotofthedata!Whyisthat?µ¶·¸LongitudinaldataMixedeffectsmodelsReasonAgeissampledbetween8and14year.Theregressionmodelsforceextrapolationtoage0!Theinterceptrepresentsadistanceatage0.Thisinducesahighcorrelationbetweentheestimatesofinterceptsandslopes.Alternative:Centerthedataatage11!Rcall:m2-lmList(distance~I(age-11),data=Orthof)postscript(girlsci1.eps)plot(intervals(m2))dev.off()µ¶·¸LongitudinaldataMixedeffectsmodelsSubject1820222426F10F09F06F01F05F07F02F08F03F04F11|||||||||||||||||||||||||||||||||(Intercept)0.00.51.0|||||||||||||||||||||||||||||||||I(age−11)Figure3:Comparisonof95%confidenceintervalsµ¶·¸LongitudinaldataMixedeffectsmodelsThemixedeffectsmodelWehaveMsubjectsandnimeasurementspersubject,randomeffectsforintercepts:yij=0+1x1ij+2x2ij+bi+ij;i=1;:::;M;j=1;:::;nibiN(0;2b)ijN(0;2)inMatrixnotation:yi=Xi+Zibi+iiN(0;)biN(0; )µ¶·¸LongitudinaldataMixedeffectsmodelsMaximumLikelihoodEstimationHierarchicalmodel:1:yiN(Xi;)2:biN(0; )Takingthemarginaldensityoverbigivesthelikelihood:L(b;; ;2jy)=MYi=1Zp(yjb;; ;2)p(b)d(b)µ¶·¸LongitudinaldataMixedeffectsmodelsTheLikelihoodp(yjb;;2)=exp( kyi Xi Zibi)k2=22)(22)M=2p(bi)=exp( bTi 1bi)=2)(2)q2pj jThisgivesthelikelihood:L(b;; ;2jy)/Mj j M=2MYi=1Zexp( fi=2)dbifi= 2((yi (Xi Zibi))T(yi Xi Zibi)+bTi 1bi))µ¶·¸LongitudinaldataMixedeffectsmodelsSimplificationL(b;; ;2jy)=1(22)N2exp PMi=1jj~yi ~Xi ~Zi^bijj222!MYi=1abs(jj)q~ZTi~Zi(1)^bi=(~ZTi~Zi) 1~ZTi(~yi ~Xi)~yi=yi0~Xi=Xi0;~Zi=Zi;;= 11=2µ¶·¸LongitudinaldataMixedeffectsmodelsAlgorithmsDirectoptimizationof(1)EM-AlgorithmLindstrom-BatesAlgorithm...µ¶·¸LongitudinaldataMixedeffectsmodelsExamplerevisitedFixedeffectsmodelwithinteraction:Rcall:m00-lm(distance~Sex*I(age-11),data=Orthodont)RandomeffectsmodeloverinterceptsRcall:m1-lme(distance~Sex*I(age-11),data=Orthodont,random=~1|Subject)µ¶·¸LongitudinaldataMixedeffectsmodelsResult:FixedeffectsCoefficients:EstimateStd.ErrortvaluePr(|t|)(Intercept)24.96880.282188.5042e-16***SexFemale-2.32100.4420-5.2518.05e-07***I(age-11)0.78440.12626.2171.07e-08***SexFemale:I(age-11)-0.30480.1977-1.5420.126---Signif.codes:0`***'0.001`**'0.01`*'0.05`.'0.1`'1Residualstandarderror:2.257on104degreesoffreedomMultipleR-Squared:0.4227,AdjustedR-squared:0.4061F-statistic:25.39on3and104DF,p-value:2.108e-12µ¶·¸LongitudinaldataMixedeffectsmodelsResult:Randomeffe
本文标题:87Mixed effects models for longitudinal data
链接地址:https://www.777doc.com/doc-4578077 .html