
Multivariate Generalised Linear Mixed Models via sabreStata (Sabre in Stata) Version 1 (Draft) Rob Crouchley Dave Stott [email protected] [email protected] Centre for e-Science Centre for e-Science Lancaster University Lancaster University John Pritchard [email protected] Centre for e-Science Lancaster University March 25, 2009 ii Contents Acknowledgements xix 1LinearModelsI 1 1.1 Random EffectsANOVA....................... 1 1.2 The Intraclass Correlation Coefficient............... 2 1.3ParameterEstimationbyMaximumLikelihood.......... 3 1.4 Regression with level-2 effects.................... 5 1.5 Example C1. Linear Model of Pupil’s Maths Achievement . 5 1.5.1 Reference........................... 6 1.5.2 Data description for hsb.dta ................ 6 1.5.3 Variables........................... 6 1.6 Including School-Level Effects-Model2.............. 8 1.6.1 Sabrecommands....................... 8 1.6.2 Sabre log file......................... 9 1.6.3 Model1discussion...................... 11 1.6.4 Model2discussion...................... 11 1.7Exercises............................... 11 1.8References............................... 12 iii iv CONTENTS 2LinearModelsII 13 2.1Introduction.............................. 13 2.2Two-LevelRandomInterceptModels................ 13 2.3 General Two-Level Models Including Random Intercepts . 15 2.4Likelihood............................... 15 2.5Residuals............................... 16 2.6CheckingAssumptionsinMultilevelModels............ 17 2.7 Example C2. Linear model of Pupil’s Maths Achievement . 18 2.7.1 References........................... 18 2.7.2 Data description for hsb.dta ................ 18 2.7.3 Variables........................... 18 2.7.4 Sabrecommands....................... 19 2.7.5 Sabre log file......................... 20 2.7.6 Discussion........................... 21 2.8ComparingModelLikelihoods.................... 22 2.9Exercises............................... 23 2.10References............................... 23 3 Multilevel Binary Response Models 25 3.1Introduction.............................. 25 3.2TheTwo-LevelLogisticModel................... 26 3.3LogitandProbitTransformations.................. 27 3.4GeneralTwo-LevelLogisticModels................. 28 3.5 Residual Intraclass Correlation Coefficient............. 28 3.6Likelihood............................... 28 CONTENTS v 3.7 Example C3. Binary Response Model of Pupil’s Repeating a GradeatPrimarySchool...................... 30 3.7.1 References........................... 30 3.7.2 Data description for thaieduc1.dta ............ 30 3.7.3 Variables........................... 30 3.7.4 Sabrecommands....................... 32 3.7.5 Sabre log file......................... 32 3.7.6 Discussion........................... 34 3.8Exercises............................... 35 3.9References............................... 35 4 Multilevel Models for Ordered Categorical Variables 37 4.1Introduction.............................. 37 4.2TheTwo-LevelOrderedLogitModel................ 38 4.3Level-1Model............................. 39 4.4Level-2Model............................. 40 4.5DichotomizationofOrderedCategories............... 40 4.6Likelihood............................... 41 4.7 Example C4. Ordered Response Model of Teacher’s Commitment toTeaching.............................. 42 4.7.1 Reference........................... 42 4.7.2 Data description for teacher1.dta and teacher2.dta .. 42 4.7.3 Variables........................... 42 4.7.4 Sabrecommands....................... 44 4.7.5 Sabre log file......................... 45 4.7.6 Discussion........................... 46 4.8Exercises............................... 47 vi CONTENTS 4.9References............................... 47 5 Multilevel Poisson Models 49 5.1Introduction.............................. 49 5.2PoissonRegressionModels...................... 50 5.3TheTwo-LevelPoissonModel.................... 50 5.4Level-1Model............................. 51 5.5Level-2Model:TheRandomInterceptModel........... 51 5.6Likelihood............................... 52 5.7ExampleC5.PoissonModelofPrescribedMedications...... 53 5.7.1 References........................... 53 5.7.2 Data description for racd.dta ............... 53 5.7.3 Variables........................... 53 5.7.4 Sabrecommands....................... 54 5.7.5 Sabre log file......................... 55 5.7.6 Discussion........................... 56 5.8Exercises............................... 57 5.9References............................... 57 6 Two-Level Generalised Linear Mixed Models 59 6.1Introduction.............................. 59 6.2TheLinearModel.......................... 60 6.3BinaryResponseModels....................... 61 6.4PoissonModel............................ 62 6.5Two-LevelGeneralisedLinearModelLikelihood.......... 62 6.6References............................... 63 CONTENTS vii 7 Three-Level Generalised Linear Mixed Models 65 7.1Introduction.............................. 65 7.2Three-LevelRandomInterceptModels............... 65 7.3 Three-LevelGLM.......................... 66 7.4Linearmodel............................. 66 7.5BinaryResponseModel....................... 67 7.6Three-LevelGeneralisedLinearModelLikelihood......... 68 7.7 Example 3LC2. Binary response model: Guatemalan mothers using prenatal care for their children (1558 mothers in 161 com- munities)............................... 69 7.7.1 References........................... 69 7.7.2 Data description for guatemala_prenat.dta ....... 69 7.7.3 Variables........................... 69 7.7.4 Sabrecommands....................... 71 7.7.5 Sabre log file......................... 71 7.7.6 Discussion........................... 73 7.8Exercises............................... 74 7.9References............................... 74 8 Multivariate Two-Level Generalised Linear Mixed Models 75 8.1Introduction.............................. 75 8.2 Multivariate 2-Level Generalised Linear Mixed Model Likelihood 76 8.3 Example C6. Bivariate Poisson Model: Number of Visits to the DoctorandNumberofPrescriptions................ 77 8.3.1 References........................... 77 8.3.2 Data description for visit-prescribe.dta ........ 77 8.3.3 Variables........................... 78 viii CONTENTS 8.3.4 Sabrecommands....................... 79 8.3.5 Sabre log file......................... 81 8.3.6 Discussion........................... 82 8.4 Example L9. Bivariate Linear and Probit Model: Wage and TradeUnionMembership...................... 84 8.4.1 References........................... 85 8.4.2 Data description for nls.dta ................ 85 8.4.3 Variables........................... 85 8.4.4 Sabrecommands....................... 87 8.4.5 Sabre log file......................... 88 8.4.6 Discussion........................... 91 8.5Exercises............................... 92 8.6References............................... 92 9EventHistoryModels 93 9.1Introduction.............................. 93 9.2DurationModels........................... 95 9.3Two-levelDurationModels..................... 96 9.4Renewalmodels............................ 97 9.5ExampleL7.RenewalModelofResidentialMobility....... 99 9.5.1 Data description for roch.dta ............... 99 9.5.2 Variables........................... 99 9.5.3 Sabrecommands.......................100 9.5.4 Sabre log file.........................101 9.5.5 Discussion...........................102 9.5.6 Exercise............................104 CONTENTS ix 9.6Three-levelDurationModels....................104 9.6.1 Exercises...........................104 9.7CompetingRiskModels.......................104 9.8Likelihood...............................107 9.9 Example L8. Correlated Competing Risk Model of Filled and LapsedVacancies...........................108 9.9.1 References...........................108 9.9.2 Data description for fillap-c.dta .............108 9.9.3 Variables...........................108 9.9.4 Sabrecommands.......................109 9.9.5 Sabre log file.........................110 9.9.6 Discussion...........................112 9.9.7 Exercises...........................114 9.10References...............................114 10 Stayers, Non-susceptibles and Endpoints 115 10.1Introduction..............................115 10.2LikelihoodwithEndpoints......................118 10.3End-points:PoissonandBinaryResponseExamples.......119 10.3.1PoissonModel........................119 10.3.2 Data description for rochmigx.dta .............119 10.3.3Variables...........................120 10.3.4BinaryResponseModel...................123 10.3.5 Data description for rochmig.dta .............123 10.3.6Variables...........................123 10.4Exercises...............................127 xCONTENTS 10.5References...............................127 11 State Dependence Models 129 11.1Introduction..............................129 11.2MotivationalExample........................130 11.3FirstOrderMarkovStateDependenceinGLMs..........132 11.3.1 Conditional Model: Conditional on the Initial Response . 132 11.4Depressionexample..........................133 11.4.1 Data description for depression2.dta ...........133 11.4.2Variables...........................133 11.4.3Sabrecommands.......................134 11.4.4 Sabre log file.........................134 11.4.5Discussion...........................135 11.5 Conditioning on the initial response but allowing the random effect 0 to be dependent on z, Wooldridge (2005) .......136 11.6Depressionexample..........................137 11.6.1Sabrecommands.......................137 11.6.2 Sabre log file.........................137 11.6.3Discussion...........................138
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages231 Page
-
File Size-