Skip to content

CovariateAdjustment/BinaryOutcomeTutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Covariate Adjustment with a Binary Outcome: Tutorial Materials

This is meant to provide a worked example of applying standardization (G-computation) to a binary outcome in R.

How to Use This Repo:

  1. Make sure you have the latest version of R and R Studio installed.

  2. Make sure that your packages are up to date (see update.packages()).

  3. If using Windows, install RTools: Toolchains. Mac and Linux should already have compilers available for building packages from source.

  4. Open R Studio: Select File > New Project > Version Control > Git:

- In the `Repository URL:` field, paste `https://github.com/CovariateAdjustment/BinaryOutcomeTutorial`
- In the `Project directory name:` field, paste `BinaryOutcomeTutorial`
- Choose a directory for cloning the repo.
  1. R Studio will open the project once it is cloned: Run 0_install_required_packages.r: This will install packages from R and CRAN.

After these steps are complete, open Covariate_Adjustment_Handout_Binary: This R Markdown report provides a step-by-step example of materials in the slides.


Content in Repository

Data

  1. `Simulated_MISTIE_III_v1.2.csv” - A spreadsheet of the data used in the example
  2. sim_MIII_MRS.Rdata - Materials used in handouts and slides
  3. sim_MIII_MRS_fixed.Rdata - Cached results used in handouts and slides

Helper Functions

  1. boot_p_value.R contains boot_p_value() which can take a boot object produced by boot::boot() and calculate a p-value by finding the smallest confidence level $\alpha$ at which the null hypothesis is rejected (i.e. the CI no longer contains the null value of the parameter).

Covariate Adjustment

  • Covariate_Adjustment_Slides_Binary contains the slides used in short courses
  • Covariate_Adjustment_Handout_Binary shows a reproducible report that walks through all of the code examples in the slides.

Additional Code

In order to reduce compiling/computing time due to the bootstrap, results are computed and cached. This code is available for users to see how the example data and results were created.

About

Applying the standardization estimator to a binary outcome

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published