help child (Directed acyclic graph (DAG) in Epidemiology)

Title

child -- generate/simulate a binary child-variable for a given DAG (directed acyclic graph)

Syntax

child
childvar parent1var parent2var ... parent20var
[if] [in]
[, options
]

Options
baserisk(#) The risk of the child-variable among the baseline/unexposed group and the default value is 0.05

p1or(odds ratio) Causal odds ratio from the parent 1 variable to the child-variable and the default value is 5

p2or(odds ratio) Causal odds ratio from the parent 2 variable to the child-variable and the default value is 5

...

p20or(odds ratio) Causal odds ratio from the parent 20 variable to the child-variable and the default value is 5

Description

Combining command ancestor, child, and childc can simulate a dataset comprising binary and continous variables for a given DAG.
ancestor is a command creating ancestor-variables for a given DAG.
child is a command creating child-variable for a given DAG.
childc is a command creating normally distributed continous child-variable for a given DAG.

At an once, the command child can create only one child variable whose parents-variables can be up to 20. By default, the risk of the child-variable is 0.05 among the baseline/unexposed group.

Options

baserisk specifies the risk of the child variable among the baseline/unexposed group. The default value is 0.05

p1or specifies the causal odds ratio from the first parent variable to the child variable. The default value is 5

p2or - p20or specifies the causal odds ratios for the second parent variable - the 20th parent-variable to the child-variable, respectively. The default odds ratios are 5

Examples

To simulate a dataset comprising variables in a DAG (E <- C -> O), suppose:

1. The ancesor-variable C is a binary variable and prevalence of the C is 0.05.

2. The child-variable E is a binary variable and the risk of E among the baseline (C=0) is 0.05

3. The causal odds ratio for C -> E is 5

4. The child-variable O is a binary variable and the risk of O among the baseline (C=0 & E=0) is 0.05

5. The causal odds ratio for E -> O is 1 and for C -> O is 5, respectively

6. We wish the population size is 10000

.clear

.set seed 150

.ancestor C, pre1(0.05) popu(10000)

.child E C, baserisk(0.05) p1or(5)

.child O E C, baserisk(0.05) p1or(1) p2or(5)

Crude analysis (without adjust for the common cause variable C)

.logistic O i.E

Adjusted for the common cause variable C

.logistic O i.E i.C

More examples

click on her

Acknowledgment

Jørn Olsen provided encouragement.

References

Sander Greenland, Judea Pearl, and James M. Robins 1999.

Causal diagrams for epidemiologic research.

Judea Pearl

Causality: Models, Reasoning and Inference. Cambridge University Press, New York, NY, USA, 2nd edition, 2009.

Lash Kenneth J. Rothman, Sander Greenland, and Timothy L. Lash.

The chapter 12: Causal Diagrams in the Epidemiology textbook of Modern Epidemiology. Wolters Kluwer, 2008.

Miguel A. Hernán, James M. Robins

The chapter 6: Graphical representation of causal effects of Causal Inference Book.

Author

Chunsen Wu, the University of Southern Denmark; Odense University Hospital, Denmark

cwu@health.sdu.dk

chunsen.wu@rsyd.dk

Also see

Help: ancestor, childc