Git Product home page Git Product logo

cibookex-r's Introduction

Repository of R and Stata code for the exercises in Causal Inference: What If by Hernán and Robins

  • The R code by Joy Shi and Sean McGrath is available here
  • The Stata code by Eleanor Murray and Roger Logan is available here
  • The book by by Hernán MA and Robins JM is available here
  • These files are rendered using bookdown.

Install dependencies

  • If you have downloaded/forked this repository you can install the R dependencies with (assuming your working directory is at the top level of the repo):
    # install.packages("devtools") # uncomment if devtools not installed
    devtools::install_dev_deps()
  • You can install the Stata dependencies, in Stata, with
    do depdendency

Building the book

  • If you need to install LaTeX, in R install the tinytex package (which is included in the dependencies) and run

    tinytex::install_tinytex()
  • Render all formats

    rmarkdown::render_site(encoding = 'UTF-8')
  • Render the PDF book

    rmarkdown::render_site(output_format = 'bookdown::pdf_book', encoding = 'UTF-8')
  • Render the HTML book

    rmarkdown::render_site(output_format = 'bookdown::gitbook_book', encoding = 'UTF-8')
  • Render the EPUB book

    rmarkdown::render_site(output_format = 'bookdown::epub_book', encoding = 'UTF-8')
  • Preview a specific chapter

    bookdown::preview_chapter("chapter-filename.Rmd")
  • To build the chapters containing Stata code:

    • You need Stata installed on your machine.
    • Running devtools::install_dev_deps() should install the Statamarkdown package by Doug Hemken.
    • The Statamarkdown package needs to be able to find your installed Stata.
    • In Stata, install the Stata dependencies, in Stata, with: do dependency.

cibookex-r's People

Contributors

remlapmot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.