balance: Check balance of pre-treatment variables across treatment...

View source: R/eda.R

balanceR Documentation

Check balance of pre-treatment variables across treatment groups

Description

Check balance of pre-treatment variables across treatment groups

Usage

balance(data, treat = NULL, reference = NULL, ttest = F, pscore = T)

Arguments

data

A data frame that contains a dummy indicator variable for the treatment and control groups.

treat

A string representing the name of the indicator variable for the treatment.

ttest

A boolean indicating whether a t-test of the difference in means between treatment and control groups should be computed.

pscore

A boolean indicating whether the propensity score should be computed. **TBI**

Details

The statistics computed here are recommended in

  • Imbens, G. W., & Rubin, D. B. (2015). Causal inference in statistics, social, and biomedical sciences: An introduction. Cambridge University Press.

Value

The function returns a list with named elements. The element asmd contains a table with the Absolute Standardized Mean Difference between groups. and control groups. The element pscore contains the propensity score of all observations. The element lpscore of the list is the logarithm of the propensity score.

Examples

data(survey)

balance(survey, treat = 'treat')

# or with a pipe
# survey %>% balance(., treat = 'treat')


DiogoFerrari/edar documentation built on Dec. 1, 2024, 10:47 p.m.