This is a simple code to illustarte the idea of simulating a prospective cohort study with an exposure, X, and a binary outcome, Y. To design and simulate the process of showing a distribution of the effect of the exposure X on the outcome probability of Y, we need four numbers: the sample size, the exposure prevalence, and the outcome probabilities among exposed and unexposed individuals.
robertthiesmeier / simualtion_example Goto Github PK
View Code? Open in Web Editor NEWStata Code for the simualtion of a simple prospective cohort study