# \donttest{
# Example usage:
GBTM_models <- fitGBTM(
data = symptoms,
outvar = paste("sx", seq(from = 0, to = 24, by = 6), sep = "_"),
catvar = FALSE,
idvar = "id",
starting_val = 500,
min_k = 2L,
max_k = 6L,
timescores = seq(from = 0, to = 24, by = 6),
timescores_indiv = FALSE,
polynomial = 1,
output = c("TECH1", 'TECH14', "SAMPSTAT", "STANDARDIZED"),
plot = "PLOT3",
save = "FSCORES",
wd = file.path("Results", "Trajectories")
)
# Accessing the model:
GBTM2 <- GBTM_models[[1]] #with 2 latent classes
GBTM3 <- GBTM_models[[2]] #with 3 latent classes
GBTM4 <- GBTM_models[[3]] #with 4 latent classes
# }
Run the code above in your browser using DataLab