rsmsn.clmm {skewlmm} | R Documentation |
Generate data from SMSN-CLMM with censored responses
Description
It creates a simulated data set from SMSN-CLMM with several possible dependence structures, with an established censoring rate or a fixed limit of detectation (LOD).
Usage
rsmsn.clmm(time, ind, x, z, sigma2, D, beta, lambda=rep(0, nrow(D)),
depStruct="UNC", phi=NULL, distr="norm", nu=NULL, type="left",
pcens=0.10, LOD=NULL)
Arguments
time |
Vector of length |
ind |
Vector of length |
x |
Design matrix for fixed effects of dimension |
z |
Design matrix for random effects of dimension |
sigma2 |
Common variance parameter, such that |
D |
Variance matrix for random effects. |
beta |
Vector of fixed effects parameter. |
lambda |
Skewness parameter of random effects. |
depStruct |
Dependence structure. |
phi |
Parameter vector indexing the dependence structure. |
distr |
Distribution that should be used. |
nu |
Degrees of freedom for Student-t and skew-t distributions. It must be greater than 2. |
type |
|
pcens |
Desired censoring rate. |
LOD |
Desired limit of detectation. If |
Value
A data frame containing time, the variable indicating groups (ind
), the generated response variable (y
), the censoring indicator variable (ci
), the lower censoring limit (lcl
), the upper censoring limit (ucl
), and possible covariates.
Author(s)
Fernanda L. Schumacher, Larissa A. Matos, Victor H. Lachos and Katherine L. Valeriano
References
Matos, L. A., Prates, M. O., Chen, M. H., and Lachos, V. H. (2013). Likelihood-based inference for mixed-effects models with censored response using the multivariate-t distribution. Statistica Sinica 23(3), 1323-1345.
Lachos, V. H., A. Matos, L., Castro, L. M., and Chen, M. H. (2019). Flexible longitudinal linear mixed models for multiple censored responses data. Statistics in medicine, 38(6), 1074-1102.
See Also
Examples
library(ggplot2)
# Generating a sample for m=25 individuals with 5 times
nj1 = 5
m = 25
time = rep(1:nj1, times=m)
groups = as.factor(rep(1:m, each=nj1))
# Considering 10% of right censoring responses and normal distribution
dat1 = rsmsn.clmm(time, groups, cbind(1,time), rep(1,m*nj1), sigma2=.25,
D=0.5*diag(1), beta=c(1,2), depStruct="ARp", phi=0.5,
type="right")
head(dat1)
ggplot(dat1, aes(x=x, y=y, group=ind)) + geom_line() +
stat_summary(aes(group=1), geom="line", fun=mean, col="blue", size=1.5) +
geom_line(aes(x=x,y=lcl), color="red", linetype="dashed")
# Considering LOD=4, left censoring, and Student-t distribution
dat2 = rsmsn.clmm(time, groups, cbind(1,time), rep(1,m*nj1), sigma2=.25,
D=0.5*diag(1), beta=c(1,2), depStruct="CS", phi=0.2,
distr="t", nu=4, LOD=4)
mean(dat2$ci) #censoring rate
ggplot(dat2, aes(x=x, y=y, group=ind)) + geom_line() +
stat_summary(aes(group=1), geom="line", fun=mean, col="blue", size=1.5) +
geom_line(aes(x=x,y=ucl), color="red", linetype="dashed")