ebalance: Descriptive Statistics in the Treatment and Control Groups

ebalanceR Documentation

Descriptive Statistics in the Treatment and Control Groups

Description

This function generates a table with descriptive statistics of numerical variables by group (Treatment versus Control groups)

Usage

ebalance(
  data,
  treatmentVar,
  alpha = 0.05,
  ttest = F,
  showMahalanobisDist = T,
  showpscore = T,
  showLinPscore = T,
  col.size = 120
)

Arguments

data

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

treatmentVar

a string with the name of the indicator variable of the treatment

alpha

number between 0 and 1. It is used to ...

ttest

boolean, indicates if a t-test of difference in means between treatment and control groups is computed

showMahalanobisDist

boolean, indicates if the Mahalanobis distance is computed

showpscore

boolean, indicates if the pscore is computed

showLinPscore

...

col.size

integer, size of the columns in the result printed in the screen

Details

The statistics computed here are recomended 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 balance constains a table with the statistics of all numerical variables by treatment and control groups. The element pscore contains the pscore of all observations. The element lpscore of the list is the logarithm of pscore.

Examples

data(edar_survey)

ebalance(edar_survey , treatmentVar='treat')

# or with paper
# edar_survey  %>% ebalance(., treatmentVar='treat')


DiogoFerrari/edar documentation built on May 8, 2022, 8:26 a.m.