dat <- data.frame(id = c(1, 2, 3, 4, 5, 6, 7, 8, 9),
cluster = c(1, 1, 1, 2, 2, 2, 3, 3, 3),
x1 = c(2, 3, 2, 1, 1, 2, 4, 3, 5),
x2 = c(3, 2, 2, 1, 2, 1, 3, 2, 5),
x3 = c(3, 1, 1, 2, 3, 3, 5, 5, 4))
# Compute Fisher z-transformed r*wg(j) for a multi-item scale with A = 5 response options
rwg.lindell(dat[, c("x1", "x2", "x3")], cluster = dat$cluster, A = 5)
# Compute Fisher z-transformed r*wg(j) for a multi-item scale with a random variance of 2
rwg.lindell(dat[, c("x1", "x2", "x3")], cluster = dat$cluster, ranvar = 2)
# Compute r*wg(j) for a multi-item scale with A = 5 response options
rwg.lindell(dat[, c("x1", "x2", "x3")], cluster = dat$cluster, A = 5, z = FALSE)
# Compute Fisher z-transformed r*wg(j) for a multi-item scale with A = 5 response options,
# do not expand the vector
rwg.lindell(dat[, c("x1", "x2", "x3")], cluster = dat$cluster, A = 5, expand = FALSE)
Run the code above in your browser using DataLab