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

Title

ancestor -- generate/simulate ancesor-variables for a given DAG (directed acyclic graph)

Syntax

ancestor
ancestor1var ancestor2var ... ancestor10var
[if] [in]
[, options
]

Options
pre1(percent) Prevalence for the first ancesor-variable in the population and the default value of the prevalence is 0.05

pre2(percent) Prevalence for the second ancesor-variable in the population and the default value of the prevalence is 0.05

...

pre15(percent) Prevalence for the fifteenth ancesor-variable in the population and the default value of the prevalence is 0.05

popu(number) The simulated population size and the default value is 10000

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 ancestor can create up to 15 ancestor-variables. By default, the prevalence of all ancestor-variables are 0.05.

Options

pre1 specifies the prevalence of the first ancestor-variable in the population. The default value of the prevalence is 0.05

pre2 - pre15 specifies the prevalence of the second ancestor-variable - the fifteenth ancestor-variable in the population, respectively. By default, all prevalence are 0.05

popu specifies the population size and the default value of the population size is 10000.

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: child, childc