Multilevel_flps.Rmd
res <- runFLPS(
inp_data = continuous,
# complied_stan = importModel('sem', T, F),
outcome = "Y",
trt = "trt",
covariate =
list(c("sex","race","pretest","stdscore"),
c("cm_sex","cm_race")),
lv_type = "sem",
multilevel = T,
lv_randomeffect = F,
lv_model = "F =~ q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 + q10",
group_id = "schid",
stan_options = list(iter = 10, cores = 1, chains = 1)
)
res <- runFLPS(
inp_data = continuous,
# complied_stan = importModel('sem', T, T),
outcome = "Y",
trt = "trt",
covariate =
list(c("sex","race","pretest","stdscore"),
c("cm_sex","cm_race")),
lv_type = "sem",
multilevel = T,
lv_randomeffect = T,
lv_model = "F =~ q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 + q10",
group_id = "schid",
stan_options = list(iter = 10, cores = 1, chains = 1)
)
binary <- binary %>%
group_by(schid) %>%
mutate(cm_sex = mean(sex),
cm_race = mean(race))
res <- runFLPS(
inp_data = binary,
# complied_stan = importModel('irt'),
outcome = "Y",
trt = "trt",
covariate =
list(c("sex","race","pretest","stdscore"), # Level 1 covariates
c("cm_sex","cm_race")), # Level 2 covariates
lv_type = "lca",
multilevel = T,
lv_randomeffect = F,
lv_model = "F =~ q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 + q10",
nclass = 2,
group_id = "schid",
stan_options = list(iter = 100, cores = 1, chains = 1)
)
binary <- binary %>%
group_by(schid) %>%
mutate(cm_sex = mean(sex),
cm_race = mean(race))
res <- runFLPS(
inp_data = binary,
# complied_stan = importModel('irt'),
outcome = "Y",
trt = "trt",
covariate =
list(c("sex","race","pretest","stdscore"), # Level 1 covariates
c("cm_sex","cm_race")), # Level 2 covariates
lv_type = "lca",
multilevel = T,
lv_randomeffect = T,
lv_model = "F =~ q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 + q10",
nclass = 2,
group_id = "schid",
stan_options = list(iter = 100, cores = 1, chains = 1)
)