MARGinal Observational Treatment-effects.1
Causal inference requires balance across the treatments to be compared. In observational studies, such balance is not guaranteed; quantifying causality therefore requires careful, multi-step workflows.
The goal of margot
is to enhance the accessibility of these workflows for causal inference. Its primary audience includes psychological scientists, although it may benefit other social scientists.
The package offers functions for:
- evaluating causal assumptions
- modelling time-series data
- reporting results
- performing sensitivity analyses
margot
focuses on streamlining the estimation of (Marginal) Average Treatment Effects, but it also supports workflows for Conditional Average Treatment Effects, Heterogeneous Treatment Effects, and Modified Treatment Policies.
This version of the package is a work in progress and experimental.
Installation
You can install the development version of margot
like so:
if (!require(devtools, quietly = TRUE)) {
install.packages("devtools")
library(devtools)
}
devtools::install_github("go-bayes/margot")
Example
library("margot")
# create transition table to evaluate the positivity assumption
transition_matrix <- create_transition_matrix(df_nz, "religion_believe_god", "id")
# create table and table explanation
table_change_belief <- transition_table(transition_matrix)
table_change_belief
Installation
You can install the development version of margot
like so:
if (!require(devtools, quietly = TRUE)) {
install.packages("devtools")
library(devtools)
}
devtools::install_github("go-bayes/margot")
Example
library("margot")
# create transition table to evaluate the positivity assumption
transition_matrix <- create_transition_matrix(df_nz, "religion_believe_god", "id")
# create table and table explanation
table_change_belief <- transition_table(transition_matrix)
table_change_belief