three_level: A dataset simulated from a three-level model

Description Usage Format Examples

Description

A dataset simulated from a three-level model

Usage

1

Format

An object of class list of length 4.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Fit a three-level model with the Laplace approximation to the likelihood
(mod_Laplace <- glmm(response ~ covariate + (1 | cluster) + (1 | group),
                     data = three_level, family = binomial,
                     method = "Laplace"))

# if we try to fit with adaptive Gaussian quadrature, we get an error
## Not run: 
  (mod_AGQ <- glmm(response ~ covariate + (1 | cluster) + (1 | group),
                   data = three_level, family = binomial, method = "AGQ",
                   control = list(nAGQ = 15)))

## End(Not run)

# We can fit with the Sequential Reduction approximation
## Not run: 
  (mod_SR <- glmm(response ~ covariate + (1 | cluster) + (1 | group),
                  data = three_level, family = binomial, method = "SR",
                  control = list(nSL = 3)))

## End(Not run)
# the estimates of the random effects standard deviations
# are larger than those using the Laplace approximation

glmmsr documentation built on May 2, 2019, 2:12 p.m.