Multivariate Generalised Linear Mixed Models via ... - · PDF fileMultivariate Generalised...
date post
10-Nov-2018Category
Documents
view
236download
1
Embed Size (px)
Transcript of Multivariate Generalised Linear Mixed Models via ... - · PDF fileMultivariate Generalised...
Multivariate Generalised Linear Mixed Modelsvia sabreStata (Sabre in Stata)
Centre for e-ScienceLancaster University
Dave [email protected] for e-ScienceLancaster University
John [email protected]
Centre for e-ScienceLancaster University
version 1
ii
Contents
Acknowledgements xix
1 Linear Models I 1
1.1 Random Effects ANOVA . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 The Intraclass Correlation Coefficient . . . . . . . . . . . . . . . 2
1.3 Parameter Estimation by Maximum Likelihood . . . . . . . . . . 3
1.4 Regression with level-2 effects . . . . . . . . . . . . . . . . . . . . 5
1.5 Example C1. Linear Model of Pupils 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 - Model 2 . . . . . . . . . . . . . . 8
1.6.1 Sabre commands . . . . . . . . . . . . . . . . . . . . . . . 8
1.6.2 Sabre log file . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.6.3 Model 1 discussion . . . . . . . . . . . . . . . . . . . . . . 11
1.6.4 Model 2 discussion . . . . . . . . . . . . . . . . . . . . . . 11
1.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.8 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
iii
iv CONTENTS
2 Linear Models II 13
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2 Two-Level Random Intercept Models . . . . . . . . . . . . . . . . 13
2.3 General Two-Level Models Including Random Intercepts . . . . . 15
2.4 Likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.5 Residuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.6 Checking Assumptions in Multilevel Models . . . . . . . . . . . . 17
2.7 Example C2. Linear model of Pupils 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 Sabre commands . . . . . . . . . . . . . . . . . . . . . . . 19
2.7.5 Sabre log file . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.7.6 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.8 Comparing Model Likelihoods . . . . . . . . . . . . . . . . . . . . 22
2.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.10 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3 Multilevel Binary Response Models 25
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.2 The Two-Level Logistic Model . . . . . . . . . . . . . . . . . . . 26
3.3 Logit and Probit Transformations . . . . . . . . . . . . . . . . . . 27
3.4 General Two-Level Logistic Models . . . . . . . . . . . . . . . . . 28
3.5 Residual Intraclass Correlation Coefficient . . . . . . . . . . . . . 28
3.6 Likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
CONTENTS v
3.7 Example C3. Binary Response Model of Pupils Repeating aGrade at Primary School . . . . . . . . . . . . . . . . . . . . . . 30
3.7.1 References . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.7.2 Data description for thaieduc1.dta . . . . . . . . . . . . 30
3.7.3 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.7.4 Sabre commands . . . . . . . . . . . . . . . . . . . . . . . 32
3.7.5 Sabre log file . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.7.6 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.9 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4 Multilevel Models for Ordered Categorical Variables 37
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.2 The Two-Level Ordered Logit Model . . . . . . . . . . . . . . . . 38
4.3 Level-1 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.4 Level-2 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.5 Dichotomization of Ordered Categories . . . . . . . . . . . . . . . 40
4.6 Likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.7 Example C4. Ordered Response Model of Teachers Commitmentto Teaching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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 Sabre commands . . . . . . . . . . . . . . . . . . . . . . . 44
4.7.5 Sabre log file . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.7.6 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
vi CONTENTS
4.9 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5 Multilevel Poisson Models 49
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.2 Poisson Regression Models . . . . . . . . . . . . . . . . . . . . . . 50
5.3 The Two-Level Poisson Model . . . . . . . . . . . . . . . . . . . . 50
5.4 Level-1 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.5 Level-2 Model: The Random Intercept Model . . . . . . . . . . . 51
5.6 Likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.7 Example C5. Poisson Model of Prescribed Medications . . . . . . 53
5.7.1 References . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.7.2 Data description for racd.dta . . . . . . . . . . . . . . . 53
5.7.3 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.7.4 Sabre commands . . . . . . . . . . . . . . . . . . . . . . . 54
5.7.5 Sabre log file . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.7.6 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.9 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6 Two-Level Generalised Linear Mixed Models 59
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.2 The Linear Model . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.3 Binary Response Models . . . . . . . . . . . . . . . . . . . . . . . 61
6.4 Poisson Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.5 Two-Level Generalised Linear Model Likelihood . . . . . . . . . . 62
6.6 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
CONTENTS vii
7 Three-Level Generalised Linear Mixed Models 65
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
7.2 Three-Level Random Intercept Models . . . . . . . . . . . . . . . 65
7.3 Three-Level GLM . . . . . . . . . . . . . . . . . . . . . . . . . . 66
7.4 Linear model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
7.5 Binary Response Model . . . . . . . . . . . . . . . . . . . . . . . 67
7.6 Three-Level Generalised Linear Model Likelihood . . . . . . . . . 68
7.7 Example 3LC2. Binary response model: Guatemalan mothersusing 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 Sabre commands . . . . . . . . . . . . . . . . . . . . . . . 71
7.7.5 Sabre log file . . . . . . . . . . . . . . . . . . . . . . . . . 71
7.7.6 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
7.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
7.9 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
8 Multivariate Two-Level Generalised Linear Mixed Models 75
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
8.2 Multivariate 2-Level Generalised Linear Mixed Model Likelihood 76
8.3 Example C6. Bivariate Poisson Model: Number of Visits to theDoctor and Number of Prescriptions . . . . . . . . . . . . . . . . 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 Sabre commands . . . . . . . . . . . . . . . . . . . . . . . 79
8.3.5 Sabre log file . . . . . . . . . . . . . . . . . . . . . . . . . 81
8.3.6 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
8.4 Example L9. Bivariate Linear and Probit Model: Wage andTrade Union Membership . . . . . . . . . . . . . . . . . . . . . . 84
8.4.1 References . . . . . . . . . . . . . . . . . . . .