TechnicalreportLinearMixed-EffectsModelinginSPSS:AnIntroductiontotheMIXEDProcedureTableofcontentsIntroduction................................................................1DatapreparationforMIXED...................................................1Fittingfixed-effectsmodels...................................................4Fittingsimplemixed-effectsmodels............................................7Fittingmixed-effectsmodels.................................................13Multilevelanalysis.........................................................16Customhypothesistests....................................................18Covariancestructureselection................................................19Randomcoefficientmodels..................................................20Estimatedmarginalmeans...................................................25References................................................................28AboutSPSSInc............................................................28SPSSisaregisteredtrademarkandtheotherSPSSproductsnamedaretrademarksofSPSSInc.Allothernamesaretrademarksoftheirrespectiveowners.©2005SPSSInc.Allrightsreserved.LMEMWP-0305IntroductionThelinearmixed-effectsmodels(MIXED)procedureinSPSSenablesyoutofitlinearmixed-effectsmodelstodatasampledfromnormaldistributions.Recenttexts,suchasthosebyMcCullochandSearle(2000)andVerbekeandMolenberghs(2000),comprehensivelyreviewmixed-effectsmodels.TheMIXEDprocedurefitsmodelsmoregeneralthanthoseofthegenerallinearmodel(GLM)procedureanditencompassesallmodelsinthevariancecomponents(VARCOMP)procedure.ThisreportillustratesthetypesofmodelsthatMIXEDhandles.WebeginwithanexplanationofsimplemodelsthatcanbefittedusingGLMandVARCOMP,toshowhowtheyaretranslatedintoMIXED.WethenproceedtofitmodelsthatareuniquetoMIXED.ThemajorcapabilitiesthatdifferentiateMIXEDfromGLMarethatMIXEDhandlescorrelateddataandunequalvariances.Correlateddataareverycommoninsuchsituationsasrepeatedmeasurementsofsurveyrespondentsorexperimentalsubjects.MIXEDextendsrepeatedmeasuresmodelsinGLMtoallowanunequalnumberofrepetitions.Italsohandlesmorecomplexsituationsinwhichexperimentalunitsarenestedinahierarchy.MIXEDcan,forexample,processdataobtainedfromasampleofstudentsselectedfromasampleofschoolsinadistrict.Inalinearmixed-effectsmodel,responsesfromasubjectarethoughttobethesum(linear)ofso-calledfixedandrandomeffects.Ifaneffect,suchasamedicaltreatment,affectsthepopulationmean,itisfixed.Ifaneffectisassociatedwithasamplingprocedure(e.g.,subjecteffect),itisrandom.Inamixed-effectsmodel,randomeffectscontributeonlytothecovariancestructureofthedata.Thepresenceofrandomeffects,however,oftenintroducescorrelationsbetweencasesaswell.Thoughthefixedeffectistheprimaryinterestinmoststudiesorexperiments,itisnecessarytoadjustforthecovariancestructureofthedata.TheadjustmentmadeinprocedureslikeGLM-Univariateisoftennotappropriatebecauseitassumesindependenceofthedata.TheMIXEDproceduresolvestheseproblemsbyprovidingthetoolsnecessarytoestimatefixedandrandomeffectsinonemodel.MIXEDisbased,furthermore,onmaximumlikelihood(ML)andrestrictedmaximumlikelihood(REML)methods,versustheanalysisofvariance(ANOVA)methodsinGLM.ANOVAmethodsproduceanoptimumestimator(minimumvariance)forbalanceddesigns,whereasMLandREMLyieldasymptoticallyefficientestimatorsforbalancedandunbalanceddesigns.MLandREMLthuspresentaclearadvantageoverANOVAmethodsinmodelingrealdata,sincedataareoftenunbalanced.TheasymptoticnormalityofMLandREMLestimators,furthermore,convenientlyallowsustomakeinferencesonthecovarianceparametersofthemodel,whichisdifficulttodoinGLM.DatapreparationforMIXEDManydatasetsstorerepeatedobservationsonasampleofsubjectsin“onesubjectperrow”format.MIXED,however,expectsthatobservationsfromasubjectareencodedinseparaterows.Toillustrate,weselectasubsetofcasesfromthedatathatappearinPotthoffandRoy(1964).ThedatashowninFigure1encode,inonerow,threerepeatedmeasurementsofadependentvariable(“dist1”to“dist3”)fromasubjectobservedatdifferentages(“age1”to“age3”).Figure1.MIXED,however,requiresthatmeasurementsatdifferentagesbecollapsedintoonevariable,sothateachsubjecthasthreecases.TheDataRestructureWizardinSPSSsimplifiesthetediousdataconversionprocess.Wechoose“Data-Restructure”fromthepull-downmenu,andselecttheoption“Restructureselectedvariablesintocases.”Wethenclickthe“Next”buttontoreachthedialogshowninFigure2.1LinearMixed-EffectsModelinginSPSSLinearMixed-EffectsModelinginSPSS2Figure2.Weneedtoconverttwogroupsofvariables(“age”and“dist”)intocases.Wethereforeenter“2”andclick“Next.”Thisbringsustothe“SelectVariables”dialogbox.Figure3.Inthe“SelectVariables”dialogbox,wefirstspecify“SubjectID[subid]”asthecasegroupidentification.Wethenenterthenamesofnewvariablesinthetargetvariabledrop-downlist.Forthetargetvariable“age,”wedrag“age1,”“age2,”and“age3”tothelistboxinthe“VariablestobeTransposed”group.Wesimilarlyassociatevariables“dist1,”“dist2,”and“dist3”withthetargetvariable“distance.”Wethendragvariablesthatdonotvarywithinasubjecttothe“FixedVariable(s)”box.Clicking“Next”bringsust