Simulates a dataset with two functional covariates, four subject-level scalar covariates, and a binary outcome.
1 2 3
The number of subjects in the simulated dataset.
The true value of the intercept.
The true value of the first covariate.
The true value of the second covariate.
The true value of the third covariate.
The true value of the fourth covariate.
The total number of possible observation times.
The average proportion of those possible times at which any given subject is observed.
measurements for each subject. The rows of this
tell the values of two time-varying covariates on a dense grid
nobs observation times. It also contains an
id variable, four subject-level covariates
s4) and one subject-level
y), which are replicated for each observation.
For each observation, there is also its observation
time, there are both the smooth latent value of the covariates
versions observed with error (
x2), and there are
also the local values of the functional regression coefficients
each row has a random value for
telling whether it should be considered as an observed data
point (versus an unobserved moment in the simulated subject's life).
include.in.subsample is simply generated as a Bernoulli random variable with
nobs is the number of simulated data rows per
simulated subject. It
should be selected to be large because
x covariates are conceptually
supposed to be smooth functions of time. However, in the
simulated data analyses we actually only use a small random
subset of the generated time points, because this is more
realistic for many behavioral and medical science datasets.
Thus, the number of possible observation times per subject
nobs, and the mean number of actual observation
times per subject is
This smaller 'observed' dataset can be obtained by
deleting from the dataset those observations having