SMNlmec.est {SMNlmec} | R Documentation |
Bayesian Censored Mixed-Effects Models with Damped Exponential Correlation Structures for Scale Mixture of Normal distributions error
Description
This function fits left, right censored mixed-effects linear model, with scale mixture of normal distribution errors, using the Stan. It returns estimates, standard errors and LPML, AIC, BIC and DIC.
Usage
SMNlmec.est(
ID,
x_set,
z_set,
tt,
y_complete,
censor_vector,
dist = "Normal",
struc = "UNC",
direction = "left",
thin_num = 1,
chains_num = 1,
iter_num = 3000,
burn_percen = 0.1,
seed_set = NULL,
adapt_delta_set = 0.8
)
Arguments
ID |
Vector |
x_set |
Design matrix of the fixed effects of order |
z_set |
Design matrix of the random effects of order |
tt |
Vector |
y_complete |
Vector |
censor_vector |
Vector |
dist |
Distribution of the random effects and random error. Available options are |
struc |
Structure of the correlation structure. Available options are |
direction |
Direction of censoring type. Available options are |
thin_num |
A positive integer specifying the period for saving samples. The default is 5. See more details in rstan::stan(). |
chains_num |
A positive integer specifying the number of chains generating by rstan::stan(). The default is 3. |
iter_num |
A positive integer specifying the number of iterations for each chain (including warmup). The default is 5000. |
burn_percen |
A percentage of the warm-up iterations in each chain the Stan. The default is 0.2. |
seed_set |
A random seed. The default is NULL. |
adapt_delta_set |
A parameter to control the sampler's behavior. The default is 0.8. See rstan::stan() for more details. |
Value
Return a S4 class SMNlmecfit object. Using function SMNlmec.summary()
to obtain the estimation of parameters and model selection criteria. The SMNlmecfit include:
stan_object |
A stanfit object from rstan::stan(). |
model_criteria |
A list includes LPML, DIC, EAIC, EBIC, K-L divergence. |
dist_set |
The setting of distribution of the stan model. |
struc_set |
The setting of correlation structure of the stan model. |
References
Kelin Zhong, Fernanda L. Schumacher, Luis M. Castro and Victor H. Lachos. Bayesian analysis of censored linear mixed-effects models for heavy-tailed irregularly observed repeated measures. Statistics in Medicine, 2025. doi:10.1002/sim.10295
Examples
require(rstan)
require(StanHeaders)
require(MASS)
require(tmvtnorm)
require(mvtnorm)
require(mnormt)
data("UTIdata_sub")
data1 <- UTIdata_sub
y1 <- c(log10(data1$RNA))
cc <- (data1$RNAcens==1)+0
y_com<-as.numeric(y1)
rho_com<-as.numeric(cc)
x <- cbind(
(data1$Fup==0)+0,
(data1$Fup==1)+0,
(data1$Fup==3)+0,
(data1$Fup==6)+0,
(data1$Fup==9)+0,
(data1$Fup==12)+0,
(data1$Fup==18)+0,
(data1$Fup==24)+0
)
z <- matrix(rep(1, length(y1)), ncol=1)
UTI_T_DEC <- SMNlmec.est(ID = data1$Patid, x_set = x, z_set = z,
tt = data1$Fup, y_complete = y_com,
censor_vector = rho_com, dist = "Student",
struc = "DEC", direction = "left",
thin_num = 1, chains_num = 1, iter_num = 3000,
burn_percen = 0.1, seed_set = 9955,
adapt_delta_set = 0.8)
SMNlmec.summary(UTI_T_DEC)