simslapmeg {SlaPMEG} | R Documentation |
Simulate longitudinal data based on a shared latent process mixed effects model (SlaPMEG)
Description
This is a simple function to simulate longitudinal data from a shared latent process mixed effects model
the data provides a good example for application of slapmeg
and pairslapmeg
and pairslapmeg
objects.
Usage
simslapmeg(
nY,
ntime,
nsubj,
pDif = 1/3,
fixed = ~1 + time,
random = ~1 + time,
fixedbeta = c(0, 2),
randbeta = c(0, 2),
group,
groupbeta = 2,
sigma.b,
sigma.u,
seed = as.integer(runif(1, 0, .Machine$integer.max)),
returnpar = FALSE
)
Arguments
nY |
number of omics in the data |
ntime |
number of repeated measures |
nsubj |
number of subjects |
pDif |
proportion of differentially expressed omics in the data (the default is 1/3) |
fixed |
A one-sided formula for the fixed-effects excluding the group variable, the default includes an intercept and time |
random |
A one-sided formula for the random-effects, the default includes an intercept and time |
fixedbeta |
effect size of fixed terms in formula, the length should match the fixed formula, the default is 0 (intercept) and 2 (time) |
randbeta |
effect size of random terms in formula, the length should match the random formula, the default is 0 (intercept) and 2 (time) |
group |
Vector indicating group membership, the length should match the number of subjects, The default is random allocation of half of subjects to each group. If use with slapmeg is intended, the group variable should have only two groups |
groupbeta |
effect size of group variable, the default is 2 |
sigma.b |
variance of the omic- / subject- specific random effects, the length should math |
sigma.u |
Variance of the subject-specific random effects, the length should math the random effects defined in random formula. If not specified, 2 values from normal distribution will be randomly assigned. |
seed |
Value of seed, if not specified a random integer will be assigned |
returnpar |
logical if TRUE, all simulation parameters will be returned along with the simulated data. |
Value
Returns a dataframe where the rows represent the observations and the columns represent the subject Id, time and group variable followed by the omics in pathway; if returnpar is TRUE, a list with both data and parametrs is returned
Author(s)
Mitra Ebrahimpoor