Generate an artificial longitudinal data set.
simulate_data( N, t_data, covariates = c(), names = NULL, relevances = c(1, 1, rep(1, length(covariates))), n_categs = rep(2, sum(covariates %in% c(2, 3))), t_jitter = 0, lengthscales = rep(12, 2 + sum(covariates %in% c(0, 1, 2))), f_var = 1, noise_type = "gaussian", snr = 3, phi = 1, gamma = 0.2, N_affected = round(N/2), t_effect_range = "auto", t_observed = "after_0", c_hat = 0, dis_fun = "gp_warp_vm", bin_kernel = FALSE, steepness = 0.5, vm_params = c(0.025, 1), continuous_info = list(mu = c(pi/8, pi, -0.5), lambda = c(pi/8, pi, 1)), N_trials = 1, force_zeromean = TRUE )
Number of individuals.
Measurement times (same for each individual, unless
Integer vector that defines the types of covariates (other than id and age). If not given, only the id and age covariates are created. Different integers correspond to the following covariate types:
Relative relevance of each component. Must have be a vector
An integer vector defining the number of categories
for each categorical covariate, so that
Standard deviation of the jitter added to the given measurement times.
A vector so that
variance of f
Either "gaussian", "poisson", "nb" (negative binomial), "binomial", or "bb" (beta-binomial).
The desired signal-to-noise ratio. This argument is valid
The inverse overdispersion parameter for negative binomial data.
The variance is
The dispersion parameter for beta-binomial data.
Number of diseased individuals that are affected by the
disease. This defaults to the number of diseased individuals. This argument
can only be given if
Time interval from which the disease effect times are sampled uniformly. Alternatively, This can any function that returns the (possibly randomly generated) real disease effect time for one individual.
Determines how the disease effect time is observed. This
can be any function that takes the real disease effect time as an argument
and returns the (possibly randomly generated) observed onset/initiation time.
Alternatively, this can be a string of the form
a constant added to f
A function or a string that defines the disease effect. If
this is a function, that function is used to generate the effect.
Should the binary kernel be used for categorical
covariates? If this is
Steepness of the input warping function. This is only used if the disease component is in the model.
Parameters of the variance mask function. This is only
Info for generating continuous covariates. Must be a
list containing fields
The number of trials parameter for binomial data.
Should each component (excluding the disease age component) be forced to have a zero mean?
An object of class lgpsim.