您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 营销创新 > 2008-使用Stata做多层次分析
1ScottishSocialSurveyNetwork:MasterClass1DataAnalysiswithStataDrVernonGayleandDrPaulLambert23rdJanuary2008,UniversityofStirlingTheSSSNisfundedunderPhaseIIoftheESRCResearchDevelopmentInitiative2MultileveldataandanalysiswithStata(in15minutes)3Generalisedlinearmodel•Y=BX+e•Y=outcomevariable(s)•X=explanatoryvariables•e=errortermforeachindividualresponseGeneralisedlinearmixedmodels–AddingcomplexitytotheGLM,suchasbydisaggregatingtheerrorstructures4Theworkofstatisticalmodelling•Yi=BXi+ei•Mostofthetime:–wehaveasingleY–weignoree–weconcentrateonwhatgoesintoB5Example•Data:BritishHouseholdPanelSurvey2005adultinterviews(7kadultsinwork)•Y=GHQscalescoreforadultsinemployment(GeneralHealthQuestionnaire,higher=worsesubjectivewell-being)•X=variouspossiblemeasures,includinggender,age,maritalstatus,occupationaladvantage,education,partner’sGHQ•Youcanrunthisexample,thefilesareat:Resultsfromfourlinearmodels1234Cons11.03**6.29**6.14**6.56**Fem1.25**1.28**1.39**Age0.22**0.23**0.22**Age-squared-0.0024**-0.0026**-0.0024**Cohab-0.33*-0.77**-0.76**-1.52**OwnCAMSIS-0.01*-0.01Father’sCAMSIS0.01Degree/Diploma-0.05Vocationalqual-0.13Noqual-0.11Works10hrs0.13Partner’sGHQ0.08**R20.00090.02340.02440.02937SomeregressionassumptionsAllvariablesaremeasuredwithouterrorsAllrelevantpredictorsoftheindependentvariableareincludedintheanalysisExpectedvalueoftheerroriszeroHeteroscedasticityoftheerrorNoautocorrelation(norelationbetweenerrortermsfordifferentcases)–[aboveusing:Menard,S.1995.AppliedLogisticRegressionAnalysis,London:Sage.]8Multilevelmodelling•Whatiftherewassomeconnectionbetweensomeofthecaseswithinthedataset?–Thisoccursbydesignincertainprojects•e.g.educationalresearch,sampleincludesmultiplechildrenfromthesameschool–Someconnections(‘hierarchicalclusters’)arestandardinmostsocialsurveys9..Individuals..PersonGroupsRegionsPSU1PSU2PSU3Wave1Wave2Wave3............Interviewers:W1,3:Interviewer1Interviewer2Interviewer3W2only:Interviewer2Interviewer3Interviewer110Howtoaccountforhierarchy/clusteringinindividualdata?1.Wecouldtryauniquedummyvar.foreverycluster–Country:Y=BX+scot+wal+Nir+e–‘areg’inStataallowsseveralhundredvariableslikethis–oftencalleda‘hierarchicalfixedeffect’–butmanyhierarchieshavetoomanyclustersforthistobesatisfactory2.Wecouldusehigherlevelexplanatoryvariables–e.g.averageunemploymentrateinlocalauthoritydistrict–thesearealso‘hierarchicalfixedeffects’3.Wecouldtrytellingthemodelthatweexpecttheerrortermstoberelated–theseare‘hierarchicalrandomeffects’=multilevelmodels11Creatingamultilevelmodel•Linearmodel:Yi=BXi+ei•Multilevelmodel(‘randomintercepts’)Yij=BXij+uj+eij•Multilevelmodel(‘randomcoefficients’)Yij=BXij+UBj+uj+eij12Howtoimplementmultilevelmodels?•InSPSSandStata,thereareextensionspecificationswhichcanbemadeinordertospecifythesimplestrandominterceptsmodel13Stataexamples•regressghqfemageage2cohab•regressghqfemageage2cohab,robustcluster(ohid)•xtmixedghqfemageage2cohab||ohid:14Comments•Modelswhichignoreclusteringshouldbeunbiassedbutinefficient•Thesimplestmultilevelmodel:Shouldn’tchangecoefficentestimates(unbiased)Shouldchangeconfidenceintervals(inefficient)1516173-levelmodelinStata(xtmixed)18ThesamemodelinMLwiN19AcontroversialclaimaboutStata•Stataisthebestpackagetouseformultilevelmodelling,because:–Itisintegratedwithdatamanagementcapacity:easytochangevariables;changecases;addhigherlevelexplanatoryvariables;etc–Ithasawiderangeofhierarchicalmodelestimators–Itallowseasycomparisonbetweenlong-standinghierarchicalestimators(fromeconomics)andnewrandomeffectsmodels•Byconstrast:–Othermainstreampackagesdon’thaveadequaterangeofmodelestimators–Specialistpackages(e.g.MLwiN;HLM)dohavemoreadvancedmodellingestimators,buttheyinhibitdatamanipulation/seriousmodelbuilding
本文标题:2008-使用Stata做多层次分析
链接地址:https://www.777doc.com/doc-4738139 .html