mexico: Data on Mexico from the Mexican Family Life Survey

Description Usage Format Examples

Description

Data for the Mexico example used in chapter 7

Usage

1

Format

A data frame with 644 rows and 11 variables:

SUBJECT

Subject ID

HOUSEHOLD

Household ID

STATE

State indicator, here 5 for the state of Coahuila

MIGR

Dummy variable indicating whether respondents have thought of migrating

NCRIME

Number of crimes of which the female respondent has been the victim

SEV

Mean seriousness of the crime

PAST

Evaluations of past life conditions

FUT

Evaluations of future community conditions

INC

Respondents' income

AGE

Respondents' age

WAVE

Indicator for the wave under analysis

...

Examples

 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))

smtorres/GLMpack documentation built on July 21, 2019, 10:59 p.m.