sim: Simulate a data frame from a DAG

View source: R/causalsim.R

simR Documentation

Simulate a data frame from a DAG

Description

Simulates a data frame from the multivariate normal distribution generated by a DAG

Usage

sim(dag, n)

Arguments

dag

a lower triangular matrix representing a DAG or a matrix that can be permutted into such a matrix.

n

the number of observations to generate.

Value

a data frame with one column for each variable in the DAG. The variables are generated from a multivariate normal distribution with mean zero and variance matrix implied by the coefficients of the DAG.


gmonette/causalsim documentation built on April 21, 2022, 1:40 a.m.