| GenerateData {landmix} | R Documentation |
Generate data
Description
Produces data from different populations with the probability of belonging to a population. Also produces one discrete covariate and one continuous covariate.
Usage
GenerateData(n, p, m, qvs, censoring.rate, simu.setting,
covariate.dependent)
Arguments
n |
sample size, must be at least 1. |
p |
number of populations, must be at least 2. |
m |
number of different mixture proportions, must be at least 2. |
qvs |
a numeric matrix of size |
censoring.rate |
a scalar indicating the censoring proportion. Options are 0 or 50. |
simu.setting |
Character indicating simulation setting. Options are "1A", "1B", "2A","2B". Setting "1A" and "1B" refer to Simulation setting 1 in the referenced paper, "1A" means the survival outcomes do NOT depend on the covariates, and "1B" means the survival outcomes do depend on the covariates. Setting "2A" and "2B" refer to Simulation setting 2 in the referenced paper, "2A" means the survival outcomes do NOT depend on the covariates, and "2B" means the survival outcomes do depend on the covariates. |
covariate.dependent |
logical indicator. If TRUE, then the survival times depend on covariates. |
Value
Returns a list containing
x: a numeric vector of length
ncontaining the observed event times for each person in the sample.delta: a numeric vector of length
nthat denotes censoring (1 denotes event is observed, 0 denotes event is censored).q: a numeric matrix of size
pbyncontaining the mixture proportions for each person in the sample.ww: a numeric vector of length
ncontaining the values of the continuous covariate for each person in the sample.zz: a numeric vector of length
ncontaining the values of the discrete covariate for each person in the sample.true.groups: numeric vector of length
ndenoting the population identifier for each person in the sample.