Description Usage Format Examples
Data for the Mexico example used in chapter 7
1 |
A data frame with 644 rows and 11 variables:
Subject ID
Household ID
State indicator, here 5 for the state of Coahuila
Dummy variable indicating whether respondents have thought of migrating
Number of crimes of which the female respondent has been the victim
Mean seriousness of the crime
Evaluations of past life conditions
Evaluations of future community conditions
Respondents' income
Respondents' age
Indicator for the wave under analysis
...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | data(mexico)
attach(mexico)
## Table 7.3
library(lme4)
cs <- function(x) scale(x,scale=TRUE,center=TRUE) # Function to re-scale
mexico.out <- glmer(MIGR ~ cs(NCRIME) + cs(SEV) + cs(PAST) +
cs(FUT) +cs(INC) + cs(AGE) + WAVE
+ (1|SUBJECT), data=mexico, family=binomial("logit"),
glmerControl(optimizer="bobyqa", tolPwrss=5e-2, optCtrl = list(maxfun=10000)))
summary(mexico.out)
se <- sqrt(diag(vcov(mexico.out)))
(cis.mexico.out <- cbind(Est = fixef(mexico.out),
LL = fixef(mexico.out) - 1.96 * se,
UL = fixef(mexico.out) + 1.96 * se))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.