| growth_schools | R Documentation |
A simulated multilevel longitudinal dataset made for the multilevel growth
mixture model. 600 students in 40 schools (15 per school) sit a reading
test on five occasions (wave 0 to 4). Two kinds of student follow two
trajectories: improving (starts near 48, gains 3 points a wave) and
plateauing (starts near 56, gains 0.3). Students vary around their
trajectory (random intercept SD 3, random slope SD 0.6, correlation -0.2;
residual SD 2). Schools are of two types: in supportive schools 80% of
students improve, in struggling schools 25% do, and a school's support
programme (standardized, measured once) makes it more likely to be
supportive. About 8% of tests were missed at random.
growth_schools
A data frame with 2780 rows (600 students, 40 schools) and 7 columns:
Integer school identifier, 1 to 40. Pass it as cluster.
Integer student identifier, 1 to 600. Pass it as id.
Integer test occasion, 0 to 4. The time variable.
Reading score.
Standardized school support programme, constant within school.
Factor, "supportive" or "struggling": the school's
generating type. Not for fitting; kept to check recovery.
Factor, "improving" or "plateauing": the student's
generating kind. Not for fitting; kept to check recovery.
The school types are what a multilevel growth mixture model's group
classes recover: mixture_regression(..., cluster = "school", n_group_classes = 2), with group_membership = "programme".
Simulated by data-raw/growth-schools.R in the source repository.
mixture_regression(), get_results.latents_growth_mixture().
descriptives(growth_schools, c("score", "programme"))
fit <- mixture_regression(score ~ wave, growth_schools, n_classes = 2,
id = "student", class_level = "group",
random = "wave", random_covariance = "equal",
cluster = "school", n_group_classes = 2,
group_membership = "programme",
n_starts = 2, seed = 1)
get_results(fit, "group_classes")
get_results(fit, "recovery", data = growth_schools, truth = "trajectory")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.