acy_sim: Simulate ACY processes

View source: R/ACY.R

acy_simR Documentation

Simulate ACY processes

Description

Generates samples from an ACY process. ACY refers to the paradigm where there are multiple dicotomous variables and a causal DAG. In acy_sim, the DAG is implemented by formulas, with the response variable on the left and the value to be calculated. on the right.

Usage

acy_sim(story = NULL, ..., samp_n = 5, numerical = "Y")

Arguments

story

Optional list containing formulas and/or label names

...

more formulas describing the process and/or label names

samp_n

Integer giving the number of rows in the output

numerical

List of (quoted) variable names for which to append a numerical output, which will be the underlying log odds for the discrete version of that variable.

Details

The calculated values are log odds. In the output, these will be converted to 0,1 dicotomous variables. Exogenous variables should be set to a constant log odds. (0 will give an equal prob of a 1/0 outcome.) Endogenous variables should be a mathematical function of the exogenous and (sometimes) other endogenous variables.

A label name can be an element of ... or story. This label will be used to denote the observed value if the underlying variable is 1. (o or 0 is used otherwise.)

Examples

acy_sim(x ~ 0, y ~ x, samp_n = 20, numerical = "y")
acy_sim(X ~ 0, Y ~ 10* X - 1, Z ~ - 3 + 10 * Y, X = 1, Y = "murder", Z = "telegraph", samp_n = 50)


dtkaplan/SDSdata documentation built on June 28, 2022, 8:09 a.m.