Robust Median-Based Bayesian Growth Curve Modeling

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.


Romeb

Romeb fits robust median-based Bayesian linear growth curve models for complete longitudinal data and for data with MCAR, MAR, or MNAR missingness mechanisms. Models are fitted through rjags, using JAGS, and posterior summaries are computed with coda.

Installation

Install the released version from CRAN:

install.packages("Romeb")

JAGS must be installed separately before fitting models with rjags.

Basic use

library(Romeb)

set.seed(123)
dat <- data.frame(
  y0 = rnorm(100),
  y1 = rnorm(100),
  y2 = rnorm(100),
  aux1 = rnorm(100)
)

fit <- Romeb(
  Missing_Type = "no missing",
  data = dat,
  time = c(0, 1, 2),
  seed = 123,
  outcome_vars = c("y0", "y1", "y2"),
  Niter = 6000,
  burnIn = 3000,
  n_adapt = 1000
)

print(fit)

Selecting outcome and auxiliary variables

Earlier versions used the legacy K argument, where the first K columns of data were treated as auxiliary variables and the following columns were treated as outcomes. The preferred interface is now explicit variable selection:

fit_mnar <- Romeb(
  Missing_Type = "MNAR",
  data = dat,
  time = c(0, 1, 2),
  seed = 123,
  outcome_vars = c("y0", "y1", "y2"),
  auxiliary_vars = "aux1",
  Niter = 6000,
  burnIn = 3000,
  n_adapt = 1000
)

auxiliary_vars is currently supported only for Missing_Type = "MNAR", where auxiliary variables enter the missingness model. The growth model itself remains a linear growth model without covariates.

Prior settings

The default priors match the original weakly informative implementation. Users may override supported hyperparameters with a named priors list:

fit_prior <- Romeb(
  Missing_Type = "no missing",
  data = dat,
  time = c(0, 1, 2),
  seed = 123,
  outcome_vars = c("y0", "y1", "y2"),
  priors = list(
    muLS_mean = c(0, 0),
    muLS_prec = c(0.001, 0.001),
    sigma_shape = 0.001,
    sigma_rate = 0.001,
    wishart_R = diag(2),
    wishart_df = 3
  )
)

Supported prior names are:

  • muLS_mean
  • muLS_prec
  • sigma_shape
  • sigma_rate
  • wishart_R
  • wishart_df
  • missing_coef_mean
  • missing_coef_prec
  • aux_coef_mean
  • aux_coef_prec

Normal priors in JAGS are parameterized by precision rather than variance.

Initial values

Users may provide initial values through inits. For one chain, use a named list. For multiple chains, use a list of named lists with length equal to chain, or provide a function accepted by rjags::jags.model().

fit_init <- Romeb(
  Missing_Type = "no missing",
  data = dat,
  time = c(0, 1, 2),
  seed = 123,
  outcome_vars = c("y0", "y1", "y2"),
  inits = list(muLS = c(0, 0))
)

If inits is omitted, Romeb generates chain-specific RNG initial values internally.

MCMC adaptation and burn-in

n_adapt controls JAGS adaptation. These iterations are not saved and are not included in posterior summaries. burnIn controls how many saved posterior draws are discarded during post-processing. Therefore, n_adapt and burnIn serve different purposes.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("Romeb")

0.2.0 by Dandan Tang, 3 months ago


https://github.com/DandanTang0/Romeb


Report a bug at https://github.com/DandanTang0/Romeb/issues


Browse source code at https://github.com/cran/Romeb


Authors: Dandan Tang [aut, cre] , Xin Tong [aut]


Documentation:   PDF Manual  


GPL-3 license


Imports coda, rjags, stats, utils

Suggests knitr, rmarkdown, testthat

System requirements: JAGS


See at CRAN