Code Monkey home page Code Monkey logo

causal-therapist-effects-paper's Introduction

A Causal Inference Perspective on Therapist Effects

This repository contains the code required to reproduce all figures and simulations reported in the manuscript, A Causal Inference Perspective on Therapist Effects (Magnusson, in preparation).

Materials

  • Preprint
    • A publicly available version of the manuscript in advance of peer-review and formal publication
  • OSF repository
  • Online analysis supplement (PDF, HTML)
    • The rendered versions of supplement.qmd
  • Interactive visualization
    • An interactive visualization of the overlap measures described in the manuscript

Reproducibility

You can render the supplement using either your local R installation or by using Docker.

The Quarto files will be output to docs/ and figures to figures/.

Build using a local R installation

The following dependencies are needed:

  • R (v4.3.0)
  • Quarto (v1.3.353)
    • With a working LaTeX installation
  • Renv (v0.17.3)

Then simply run:

R -e 'renv::restore()'
quarto render

Build using Docker

You can also build the project using Docker, without having to install any additional dependencies.

docker build \
    --build-arg R_VERSION=4.3.0 \
    --build-arg QUARTO_VERSION=1.3.353 \
    --build-arg RENV_VERSION=0.17.3 \
    -t causal-therapist-effects .

Then use the Docker image to run the simulation and render the Quarto project inside a new container.

docker run \
    --rm \
    -v "$(pwd)/supplement.qmd:/home/supplement.qmd" \
    -v "$(pwd)/_quarto.yml:/home/_quarto.yml" \
    -v "$(pwd)/docker/figures:/home/figures" \
    -v "$(pwd)/docker/docs:/home/output" \
    -v "$(pwd)/docker/tmp:/home/tmp" \
    -e MAX_CORES=8 \
    -e N_SIM=10000 \
    -e N_SIM_CI=1000 \
    causal-therapist-effects

The variable MAX_CORES controls how many CPU cores the simulation will use, N_SIM sets the number of simulations for the confounding example, and N_SIM_CI controls the confidence interval simulation.

Remove ./docker/tmp/simulation.rds to rerun the simulation.

Blinded output

The "blinded" profile can be used for masked peer review. Masked documents will be saved to ./docs-blinded

quarto render --profile blinded

causal-therapist-effects-paper's People

Contributors

rpsychologist avatar

Stargazers

 avatar

Watchers

 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.