Example FLPS models

FLPS with Rasch model

data(binary)
binary <- binary[c(sample(which(binary$trt == 1), 500), 
                   sample(which(binary$trt == 0), 500)),]

res <- runFLPS(
  inp_data = binary,
  outcome = "Y",
  trt = "trt",
  covariate = c("sex","race","pretest","stdscore"),
  lv_type = "rasch",
  lv_model = "F =~ q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 + q10",
  stan_options = list(iter = 5000, cores = 1, chains = 2)
)

FLPS with multidimensional Rasch model

binary <- binary[c(sample(which(binary$trt == 1), 500), 
                   sample(which(binary$trt == 0), 500)),]

res <- runFLPS(
  inp_data = binary,
  outcome = "Y",
  trt = "trt",
  covariate = c("sex","race","pretest","stdscore"),
  lv_type = "rasch",
  lv_model = "
  F1 =~ q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 + q10
  F2 =~ q11 + q12 + q13 + q14 + q15 + q16 + q17 + q18 + q19 + q20",
  stan_options = list(iter = 5000, cores = 1, chains = 2)
)

FLPS with 2PL model

data(binary)
binary <- binary[c(sample(which(binary$trt == 1), 500), 
                   sample(which(binary$trt == 0), 500)),]

res <- runFLPS(
  inp_data = binary,
  outcome = "Y",
  trt = "trt",
  covariate = c("sex","race","pretest","stdscore"),
  lv_type = "irt",
  lv_model = "F =~ q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 + q10",
  stan_options = list(iter = 5000, cores = 1, chains = 2)
)

FLPS with graded response model

data(graded)
graded <- graded[c(sample(which(graded$trt == 1), 500), 
                   sample(which(graded$trt == 0), 500)),]

res <- runFLPS(
  inp_data = graded,
  outcome = "Y",
  trt = "trt",
  covariate = c("sex","race","pretest","stdscore"),
  lv_type = "grm",
  lv_model = "F =~ q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 + q10",
  stan_options = list(iter = 5000, cores = 1, chains = 2)
)

FLPS with CFA model

data(continuous)
continuous <- continuous[c(sample(which(continuous$trt == 1), 500),
                           sample(which(continuous$trt == 0), 500)),]

res <- runFLPS(
  inp_data = continuous,
  outcome = "Y",
  trt = "trt",
  covariate = c("sex","race","pretest","stdscore"),
  lv_type = "sem",
  lv_model = "F =~ q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 + q10",
  stan_options = list(iter = 5000, cores = 1, chains = 2)
)