# `boots` is lowered from its default of 2000 throughout these examples so
# they run quickly; a reported analysis should use the default.
# Build a small two-occasion dataset in long format (one row per person per
# occasion). In practice `data` already stores the repeated occasions this
# way; here we stack two copies of jz2017 as an illustration.
data("jz2017")
scales <- c("PA", "BC", "DE", "FG", "HI", "JK", "LM", "NO")
t1 <- jz2017[, scales]
t1$id <- seq_len(nrow(t1))
t1$occasion <- "T1"
t2 <- t1
t2$occasion <- "T2"
long <- rbind(t1, t2)
# \donttest{
# Per-occasion SSM profiles from long-format data
ssm_analyze_long(
long, scales = scales, id = "id", occasion = "occasion",
boots = 200
)
# }
Run the code above in your browser using DataLab