| vam_data | R Documentation |
A data set simulated from a variable persistence model, illustrating a model with perfectly correlated current and future effects for each teacher.
data(vam_data)
A data frame with 3,750 observations on 1,250 students over three years, with 50 teachers in each year, and five variables:
Numeric student identifier.
Numeric teacher identifier, interpreted within year.
Numeric observation year, from 1 to 3.
Numeric student score.
Numeric continuous covariate.
Scores combine a student effect, current and persistent teacher effects, the continuous covariate, and independent errors. The persistence multiplier is 0.4. The student, teacher, and residual standard deviations are each 5; the covariate standard deviation is 4 and its coefficient is 1.
The original simulation used the following code and R's pre-3.6.0
"Rounding" sampler. On R 3.6.0 or later, first select
RNGkind(sample.kind = "Rounding") to reproduce the supplied data,
and restore your preferred RNG settings afterward. With that sampler,
the code reproduces the stored data exactly.
set.seed(0) years <- 3 teachers <- 50 students <- 25 alpha <- .4 eta.stu <- rnorm(students * teachers, 0, 5) z1 <- rep(1:teachers, each = students) z2 <- sample(rep(1:teachers, each = students)) z3 <- sample(rep(1:teachers, each = students)) cont_var1 <- rnorm(students * teachers, 0, 4) cont_var2 <- rnorm(students * teachers, 0, 4) cont_var3 <- rnorm(students * teachers, 0, 4) gam1 <- rnorm(teachers, 0, 5) gam2 <- rnorm(teachers, 0, 5) gam3 <- rnorm(teachers, 0, 5) eps1 <- rnorm(students * teachers, 0, 5) eps2 <- rnorm(students * teachers, 0, 5) eps3 <- rnorm(students * teachers, 0, 5) y1 <- eta.stu + gam1[z1] + cont_var1 + eps1 y2 <- eta.stu + gam1[z1] * alpha + gam2[z2] + cont_var2 + eps2 y3 <- eta.stu + gam1[z1] * alpha + gam2[z2] * alpha + gam3[z3] + cont_var3 + eps3 student <- 1:(students * teachers) teacher <- c(z1, z2, z3) cont_var <- c(cont_var1, cont_var2, cont_var3) year <- rep(1:3, each = students * teachers) y <- c(y1, y2, y3) vam_data <- as.data.frame(cbind(student, teacher, year, y, cont_var))
data(vam_data)
head(vam_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.