bmrarm_simulations | R Documentation |
A list, which contains two lists of data frames that are used in the simulated bmrarm examples. Data frame 167 from bmrarm_simulations$ar_data_list is the randomly selected dataset used to assess convergence.
bmrarm_simulations
Two lists of data frames. One list contains data generated with an autoregressive term, the other without:
list of 400 dataframes generated using bmrarm with rho = 0.35
list of 400 dataframes generated using bmrarm with rho = 0
true continuous values for the ordinal outcome, unused for modeled
ordinal outcome, obtained from discretizing y1
observed continuous outcome
patient identifier, integer
time since baseline, integer
identifies if data was used for training or testing. Only applicable to ar_data_list data frames as all data was training data for the slope_data_list data frames.
## Not run:
# Assess convergence by fitting four separate chains
burn <- 5000; sims <- 25000; mod_list <- list()
for(i in 1:4) {
mod_list[[i]] <- bmrarm(formula = cbind(y_ord, y2) ~ time,
data = bmrarm_simulations$ar_data_list[[167]],
ordinal_outcome = "y_ord", patient_var = "pat_idx",
random_slope = T, time_var = "time", ar_cov = T,
burn_in = burn, nsim = sims, thin = 5, seed = i,
sd_vec = c(0.14, 0.14, 0.35, 0.1, 0.23, 0.09))
}
# Fit a bmrarm to each of the 400 AR datasets (\eqn{rho = 0.35})
for(i in 1:400){
samps <- bmrarm(formula = cbind(y_ord, y2) ~ time,
data = bmrarm_simulations$ar_data_list[[i]],
ordinal_outcome = "y_ord", patient_var = "pat_idx",
random_slope = T, time_var = "time", ar_cov = T,
burn_in = burn, nsim = sims, thin = 5, seed = i,
sd_vec = c(0.14, 0.15, 0.35, 0.1, 0.2, 0.09))
mDIC <- get_DIC(samps)
cDIC <- get_DIC(samps, marginal = FALSE)
f_out <- paste0("./ar_model_ar_data", i, ".RDS")
saveRDS(list(samps = samps, data = sim_data), file = f_out)
}
## End(Not run)
bmrarm_simulations
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.