ebalance | R Documentation |
This function generates a table with descriptive statistics of numerical variables by group (Treatment versus Control groups)
ebalance( data, treatmentVar, alpha = 0.05, ttest = F, showMahalanobisDist = T, showpscore = T, showLinPscore = T, col.size = 120 )
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 |
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.
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.
data(edar_survey) ebalance(edar_survey , treatmentVar='treat') # or with paper # edar_survey %>% ebalance(., treatmentVar='treat')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.