Description Usage Arguments Details Value Note Author(s) References Examples
This function is simply a wrapper for xBalance{RItools}
. Given covariates, a treatment variable, and (optionally) a stratifying factor, it calculates standardized mean differences along each covariate, and tests for conditional independence of the treatment variable and the covariates.
1 | checkBalance(formula, data, report = "all", ...)
|
formula |
A formula containing an indicator of treatment assignment on the left hand side and covariates at right. |
data |
A data frame in which the formula and (optionally) strata are to be evaluated. |
report |
Character vector listing measures to report for each stratification; a subset of c("adj.means","adj.mean.diffs", "adj.mean.diffs.null.sd", "chisquare.test", "std.diffs","z.scores","p.values","all"). P-values reported are two-sided for the null-hypothesis of no effect. The option "all" requests all measures. |
... |
Additional arguments passed to |
See help("xBalance")
for details.
An object of class c("xbal", "list")
. There are plot
, print
, and xtable
methods for class xbal
.
Evidence pertaining to the hypothesis that a treatment variable is not associated with differences in covariate values is assessed by comparing the differences of means (or regression coefficients), without standardization, to their distributions under hypothetical shuffles of the treatment variable, a permutation or randomization distribution. For the unstratified comparison, this reference distribution consists of differences (more generally, regression coefficients) when the treatment variable is permuted without regard to strata. For the stratified comparison, the reference distribution is determined by randomly permuting the treatment variable within strata, then re-calculating the treatment-control differences (regressions of each covariate on the permuted treatment variable). Significance assessments are based on the large-sample Normal approximation to these reference distributions.
Leo Guelman <leo.guelman@gmail.com>
Hansen, B.B. and Bowers, J. (2008). Covariate Balance in Simple, Stratified and Clustered Comparative Studies. Statistical Science 23.
Kalton, G. (1968). Standardization: A technique to control for extraneous variables. Applied Statistics 17, 118-136.
1 2 3 4 5 6 7 |
Loading required package: RItools
Loading required package: SparseM
Attaching package: 'SparseM'
The following object is masked from 'package:base':
backsolve
Loading required package: MASS
Loading required package: coin
Loading required package: survival
Loading required package: tables
Loading required package: Hmisc
Loading required package: lattice
Loading required package: Formula
Loading required package: ggplot2
Attaching package: 'Hmisc'
The following objects are masked from 'package:base':
format.pval, units
Loading required package: penalized
Welcome to penalized. For extended examples, see vignette("penalized").
strata unstrat
stat treat=0 treat=1 adj.diff adj.diff.null.sd std.diff z
vars
X1 0.01152 -0.00596 -0.01748 0.06006 -0.01840 -0.29103
X2 0.03160 -0.02812 -0.05972 0.06236 -0.06057 -0.95778
X3 0.01145 -0.02242 -0.03387 0.06355 -0.03370 -0.53303
X4 0.01533 -0.03551 -0.05083 0.06370 -0.05046 -0.79801
X5 -0.06440 0.02370 0.08810 0.06153 0.09060 1.43175
X6 0.02237 -0.02177 -0.04414 0.06308 -0.04425 -0.69980
---Overall Test---
chisquare df p.value
unstrat 4.54 6 0.604
---
Signif. codes: 0 '***' 0.001 '** ' 0.01 '* ' 0.05 '. ' 0.1 ' ' 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.