qrjm: 'qrjm' fits quantile regression joint model

View source: R/qrjm.R

qrjmR Documentation

qrjm fits quantile regression joint model

Description

Function using JAGS via jagsUI package to estimate the quantile regression joint model assuming asymmetric Laplace distribution for residual error. Joint modeling concerns longitudinal data and time-to-event

Usage

qrjm(
  formFixed,
  formRandom,
  formGroup,
  formSurv,
  survMod = "weibull",
  param = "value",
  timeVar,
  data,
  tau,
  RE_ind = FALSE,
  n.chains = 3,
  n.iter = 10000,
  n.burnin = 5000,
  n.thin = 5,
  n.adapt = 5000,
  precision = 10,
  C = 1000,
  save_jagsUI = TRUE,
  save_va = FALSE,
  parallel = FALSE
)

Arguments

formFixed

formula for fixed part of longitudinal submodel with response variable

formRandom

formula for random part of longitudinal submodel without response variable

formGroup

formula specifying the cluster variable (e.g. = ~ subject)

formSurv

survival formula as formula in survival package for latency submodel

survMod

specifying the baseline risk function for Cox proportional hazard model (only "weibull" is available until now)

param

shared association including in joint modeling: the classical shared random effects or the current value denoting by "sharedRE" (default) or "value", respectively.

timeVar

string specify the names of time variable (time of repeated measurements)

data

dataset of observed variables

tau

the quantile(s) to be estimated. This must be a number between 0 and 1, otherwise the execution is stopped. If more than one quantile is specified, rounding off to the 4th decimal must give non–duplicated values of tau, otherwise the execution is stopped.

RE_ind

Boolean denoting if the random effects are assumed independent ; default is FALSE

n.chains

the number of parallel chains for the model; default is 1.

n.iter

integer specifying the total number of iterations; default is 10000

n.burnin

integer specifying how many of n.iter to discard as burn-in ; default is 5000

n.thin

integer specifying the thinning of the chains; default is 1

n.adapt

integer specifying the number of iterations to use for adaptation; default is 5000

precision

variance by default for vague prior distribution

C

value used in the zero trick; default is 1000.

save_jagsUI

If TRUE (by default), the output of jagsUI package is returned by the function

save_va

If TRUE (is FALSE by default), the draws of auxilary variable W is returned by the function

parallel

see jagsUI::jags() function

Value

A BQt object is a list with the following elements:

mean

list of posterior mean for each parameter

median

list of posterior median for each parameter

modes

list of posterior mode for each parameter

StErr

list of standard error for each parameter

StDev

list of standard deviation for each parameter

ICs

list of the credibility interval at 0.95 for each parameters excepted for covariance parameters in covariance matrix of random effects. Otherwise, use save_jagsUI=TRUE to have the associated quantiles.

data

data included in argument

sims.list

list of the MCMC chains of the parameters and random effects

control

list of arguments giving details about the estimation

random_effect

list for each quantile including both posterior mean and posterior standard deviation of subject-specific random effects

out_jagsUI

only if save_jagsUI=TRUE in argument: list including posterior mean, median, quantiles (2.5 Moreover, this list also returns the MCMC draws, the Gelman and Rubin diagnostics (see output of jagsUI objects)

Author(s)

Antoine Barbieri

References

Ming Yang, Sheng Luo, and Stacia DeSantis (2019). Bayesian quantile regression joint models: Inference and dynamic predictions. Statistical Methods in Medical Research, 28(8):2524-2537. doi: 10.1177/0962280218784757.

Examples


## Not run: 
#---- use the data 'aids' from joineR package
data("aids", package = "joineR")

#---- Fit quantile regression joint model for the first quartile
qrjm_25 <- qrjm(formFixed = CD4 ~ obstime,
               formRandom = ~ obstime,
               formGroup = ~ id,
               formSurv = Surv(time, death) ~ drug + gender + prevOI + AZT,
               survMod = "weibull",
               param = "value",
               timeVar= "obstime",
               data = aids,
               tau = 0.25)

#---- Visualize the trace for beta parameters
jagsUI::traceplot(qrjm_25$out_jagsUI, parameters = "beta" )

#---- Get the estimated coefficients : posterior means
qrjm_25$mean

#---- Summary of output
BQt::summary.BQt(qrjm_25)

## End(Not run)


AntoineBbi/BQt documentation built on June 25, 2022, 3:32 p.m.