simobs {simcausal} | R Documentation |
Simulate Observed Data
Description
This function simulates observed data from a DAG object.
Usage
simobs(
DAG,
n,
wide = TRUE,
LTCF = NULL,
rndseed = NULL,
rndseed.reset.node = NULL,
verbose = getOption("simcausal.verbose")
)
Arguments
DAG |
A DAG objects that has been locked with set.DAG(DAG). Observed data from this DAG will be simulated. |
n |
Number of observations to sample. |
wide |
A logical, if TRUE the output data is generated in wide format, if FALSE, the output longitudinal data in generated in long format |
LTCF |
If forward imputation is desired for the missing variable values, this argument should be set to the name of the node that indicates the end of follow-up event. See the vignette, |
rndseed |
Seed for the random number generator. |
rndseed.reset.node |
When |
verbose |
Set to |
Value
A data.frame
where each column is sampled from the conditional distribution specified by the corresponding DAG
object node.
See Also
simfull
- a wrapper function for simulating full data only; sim
- a wrapper function for simulating both types of data; doLTCF
for forward imputation of the missing values in already simulating data; DF.to.long
, DF.to.longDT
- converting longitudinal data from wide to long formats.
Other simulation functions:
simfull()
,
sim()