Learn R Programming

glmmsr (version 0.2.3)

three_level: A dataset simulated from a three-level model

Description

A dataset simulated from a three-level model

Usage

three_level

Arguments

Format

An object of class list of length 4.

Examples

Run this code
# NOT RUN {
# 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)))
# }
# 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)))
# }
# NOT RUN {
# the estimates of the random effects standard deviations
# are larger than those using the Laplace approximation
# }

Run the code above in your browser using DataLab