| Title: | Robust Median-Based Bayesian Growth Curve Modeling |
|---|---|
| Description: | Implements robust median-based Bayesian linear growth curve models for complete data and for data with Missing Completely at Random (MCAR), Missing At Random (MAR), or Missing Not At Random (MNAR) mechanisms. Models are fitted using 'rjags' through 'JAGS' and posterior summaries are computed with 'coda'. The main function allows users to specify outcome variables, auxiliary variables for MNAR missingness models, prior hyperparameters, and initial values directly through function arguments. |
| Authors: | Dandan Tang [aut, cre] (ORCID: <https://orcid.org/0009-0007-3453-9660>), Xin Tong [aut] |
| Maintainer: | Dandan Tang <[email protected]> |
| License: | GPL-3 |
| Version: | 0.2.0 |
| Built: | 2026-10-15 08:45:32 UTC |
| Source: | https://github.com/cran/Romeb |
JAGS model definition for the robust median-based Bayesian linear growth
model used for complete data, MCAR, and MAR analyses. Prior hyperparameters
are supplied through the data list by Romeb().
modelmodel
A character string.
JAGS model definition for the robust median-based Bayesian linear growth
model with an MNAR selection model. Prior hyperparameters are supplied
through the data list by Romeb().
model_MNARmodel_MNAR
A character string.
JAGS model definition for the robust median-based Bayesian linear growth
model with an MNAR selection model that includes auxiliary variables.
Prior hyperparameters are supplied through the data list by Romeb().
model_MNAR_kmodel_MNAR_k
A character string.
A real data set from the 1976–1980 National Youth Survey of U.S. youth.
NYSNYS
A data frame with 1,725 rows and 7 variables:
Participant age (years)
Gender (0 = female, 1 = male)
Attitude toward social deviance, wave 1
Attitude toward social deviance, wave 2
Attitude toward social deviance, wave 3
Attitude toward social deviance, wave 4
Attitude toward social deviance, wave 5
National Youth Survey, waves 1976–1980 (downloadable at https://www.icpsr.umich.edu/icpsrweb/ICPSR/series/88)
Implements a focused robust median-based Bayesian linear growth-curve model without covariates in the growth model. The package supports complete-data, MCAR/MAR, MNAR, and MNAR-with-auxiliary-variable missing-data analyses. Auxiliary variables, when used, enter the missingness model rather than the growth model. Models are fitted via rjags/JAGS and summarized with coda.
Fits a robust median-based Bayesian linear growth curve model under complete data, MCAR/MAR, MNAR, or MNAR-with-auxiliary-variable assumptions. The current implementation fits a linear growth model without covariates in the growth model. Auxiliary variables, if supplied, are included only in the MNAR missingness model.
Romeb( Missing_Type, data, time, seed, K = 0, outcome_vars = NULL, auxiliary_vars = NULL, priors = list(), inits = NULL, chain = 1, Niter = 6000, burnIn = 3000, n_adapt = 1000 )Romeb( Missing_Type, data, time, seed, K = 0, outcome_vars = NULL, auxiliary_vars = NULL, priors = list(), inits = NULL, chain = 1, Niter = 6000, burnIn = 3000, n_adapt = 1000 )
Missing_Type |
Character; one of |
data |
Matrix or data frame containing outcome columns and, optionally, auxiliary variables. |
time |
Numeric vector of measurement times, e.g., |
seed |
Integer-valued numeric scalar used for reproducibility. |
K |
Integer; legacy argument giving the number of auxiliary variables in
the first |
outcome_vars |
Optional column names or column indices identifying the
outcome variables. If omitted, the function uses the legacy layout implied
by |
auxiliary_vars |
Optional column names or column indices identifying auxiliary variables. These variables are used only for MNAR models. |
priors |
Optional named list of prior hyperparameters. See Details. |
inits |
Optional initial values passed to |
chain |
Integer; number of MCMC chains. Default is 1. |
Niter |
Integer; iterations per chain. Default is 6000. |
burnIn |
Integer; burn-in iterations discarded before posterior summaries
are computed. Default is 3000. Must be smaller than |
n_adapt |
Integer; number of JAGS adaptation iterations run before posterior sampling. These iterations are not saved and are not included in posterior summaries. Default is 1000. Setting this to 0 is allowed but is generally not recommended for complex models. |
The default priors match the original weakly informative implementation:
muLS[j] ~ dnorm(0, 0.001), pre_sigma ~ dgamma(0.001, 0.001),
Inv_cov ~ dwish(diag(2), 3), and, for MNAR models,
r0, r1, r2, and auxiliary coefficients follow
dnorm(0, 0.001) priors. Users can override these defaults with a
named priors list. Unknown prior names trigger an error to avoid
silently ignoring misspecified user inputs. Supported elements are
muLS_mean, muLS_prec, sigma_shape, sigma_rate,
wishart_R, wishart_df, missing_coef_mean,
missing_coef_prec, aux_coef_mean, and aux_coef_prec.
In JAGS, normal priors are parameterized by precision, not variance.
The n_adapt argument controls JAGS adaptation only; it is separate
from burnIn, which discards saved posterior samples during
post-processing. For Missing_Type = "no missing", the selected
outcome variables must contain no missing values. MCAR and MAR
use the same observed-data outcome model; no explicit missingness model is
fitted unless Missing_Type = "MNAR".
An object of class RomebResult. The returned object is a list
with the following components:
quantilesPosterior means, standard deviations, and quantiles with descriptive parameter labels.
gewekeGeweke z-scores.
credible_intervalsEqual-tail 95 percent credible intervals.
hpd_intervalsHighest posterior density intervals.
samps_fullThe full coda::mcmc.list object,
relabeled with descriptive parameter names.
parameter_mapA data frame mapping descriptive parameter names to the corresponding model parameters.
model_infoA list containing the model type, selected outcome variables, selected auxiliary variables, prior settings, and MCMC settings.
Maintainer: Dandan Tang [email protected] (ORCID)
Authors:
Xin Tong
Useful links:
set.seed(123) dat <- data.frame( age0 = rnorm(30), age1 = rnorm(30), age2 = rnorm(30), aux1 = rnorm(30) ) time <- c(0, 1, 2) outcome_vars <- c("age0", "age1", "age2") head(dat) ## Not run: fit <- Romeb( Missing_Type = "no missing", data = dat, time = time, seed = 123, outcome_vars = outcome_vars, chain = 1, Niter = 1000, burnIn = 500, n_adapt = 500 ) print(fit) ## End(Not run)set.seed(123) dat <- data.frame( age0 = rnorm(30), age1 = rnorm(30), age2 = rnorm(30), aux1 = rnorm(30) ) time <- c(0, 1, 2) outcome_vars <- c("age0", "age1", "age2") head(dat) ## Not run: fit <- Romeb( Missing_Type = "no missing", data = dat, time = time, seed = 123, outcome_vars = outcome_vars, chain = 1, Niter = 1000, burnIn = 500, n_adapt = 500 ) print(fit) ## End(Not run)