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

Title

childc -- generate/simulate a normally distributed continous child-variable for a given DAG (directed acyclic graph)

Syntax

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

Options
* baselevel(mean sd) The mean and standard deviation for the child-variable among the baseline/unexposed group

p1coe(coefficient) Causal coefficient from the parent 1 variable to the child-variable and the default value is 5

p2coe(coefficient) Causal coefficient from the parent 2 variable to the child-variable and the default value is 5

...

p20coe(coefficient) Causal coefficient 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 binary ancestor-variables for a given DAG.
child is a command creating binary 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 childc can create only one child-variable whose parents variables can be up to 20.

Options

baselevel specifies the mean and standard deviation of the child-variable among the baseline/unexposed group.

p1coe specifies the causal coefficient from the first parent-variable to the child-variable. The default value is 5

p2coe - p20or specifies the causal coefficient for the second parent-variable - the 20th parent-variable to the child-variable, respectively. The default values for all coefficient 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 normally distributed continous variable with mean=25 and sd=2 among the baseline (C=0 & E=0)

5. The causal coefficient for E -> O is 0 and for C -> O is 10, respectively

6. We wish the population size is 10000

.clear

.set seed 126

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

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

.childc O E C, baselevel(25 2) p1coe(0) p2coe(10)

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

.regress O i.E

Adjusted for the common cause variable C

.regress 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, child