# estimate a model using simulated_data_rnorm
formula <- y ~ -1 + x1 + x2 + x3 | id
k <- 2
stv <- setNames(c(0.2,0.2,0.2,1,1),c(colnames(simulated_data_norm)[3:5],c("sigma","theta")))
control <- list(iter.max = 1000, verbose = 4)
hyflex_mod <- hyreg2(formula = formula,
data = simulated_data_norm,
type = simulated_data_norm$type,
stv = stv,
k = k,
type_cont = "TTO",
type_dich = "DCE_A",
opt_method = "L-BFGS-B",
control = control,
latent = "cont",
id_col = "id"
)
# plotting the variables id against y
plot_hyreg2(data = simulated_data_norm,
x = "id",
y = "y",
id_col = "id",
class_df_model = give_class(data = simulated_data_norm,
model = hyflex_mod,
id = "id"))
Run the code above in your browser using DataLab