Provides a graphic that depicts covarite effect size
differences between treatment groups both before and after
stratification. Function will create stata internally if desired, and
returns numerical output used to create graphic.
Dataframe of covariates. Factors should be recoded
using cv.trans.psa
treatment
Binary vector or factor defining the two treatments
propensity
Vector of same length as treatment containing estimated propensity scores.
strata
Either a vector of same length as treatment of
predefined stratum number, or one
integer n used to assign rows to n strata
propensity scores, each of approximately
the same number of cases. If relatively few unique propensity scores
have been defined (as from a
classification tree) then the logical tree should be set equal to TRUE.
int
Either a number m used to divide [0,1] into
m equal length subintervals,
or a vector containing cut points between 0 and 1 that define
subintervals (perhaps as suggested by loess.psa).
In either case the subintervals define strata, for which sizes can differ.
tree
Logical, default FALSE. If there are few unique
propensity scores, say from a recursively partitioned tree,
then TRUE forces strata to be defined by the unique propensity scores.
minsize
Smallest allowable stratum-treatment size. If violated, rows in the stratum are removed. User may wish to redefine strata.
universal.psd
Logical, default = TRUE. Forces standard
deviations used to be unadjusted for stratification.
trM
Numeric, default = 0; passed to mean for trimming purposes.
absolute.es
Logical, default TRUE. If TRUE, graphic depicts absolute values of all effect sizes. Note that the adjusted effect size plotted is the absolute value of weighted averages of the signed by-stratum effect size values when absolute.es is TRUE.
trt.value
Character string; if desired allows the name of an active
treatment to be given. Should be a level (value) of the
treatment factor (vector).
use.trt.var
Logical, default FALSE. If TRUE, uses just active
treatment standard deviations for effect size, as per a suggestion of
Rubin and Stuart (see reference below).
verbose
Logical, default FALSE. Numerical output is returned invisibly.
xlim
Binary vector passed to plot for overriding default
choices. Default NULL.
plot.strata
Logical, default TRUE. Adds effect size values for individual strata to graphic.
...
Other graphical parameters passed to plot.
Details
Effect sizes between treatments for each covariate are
presented in one graphic, both before and after stratification.
Value
Graphic plots covariate balance before and after stratication on propensity scores.
The default version (absolute.es = TRUE) plots the absolute values of effect sizes for each stratum, though the
overall estimate is the weighted mean before taking the absolute values.
Numerical output consists of seven addressable objects. If verbose
is FALSE (default), output is not printed.
original.strata
Matrix of strata-treatment counts as originally input.
strata.used
Matrix of strata-treatment counts used in effectsize
calculations after any
minsize reductions.
mean.diff.strata.wtd
Matrix of strata by covariate weighted (by
strata size) average differences.
mean.diff.unadj
Matrix of covariate effects sizes before stratification.
effect.sizes
Matrix of effect sizes by covariate and statum.
treatment.levels
Names of treatments.
effects.strata.treatment
Matrix of standard deviations and
stratum-treatment covariate means used to calculate the effect.sizes.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(PSAgraphics)
Loading required package: rpart
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/PSAgraphics/cv.bal.psa.Rd_%03d_medium.png", width=480, height=480)
> ### Name: cv.bal.psa
> ### Title: Multiple Covariate Balance Assessment Plot
> ### Aliases: cv.bal.psa
> ### Keywords: hplot
>
> ### ** Examples
>
> data(lindner)
> attach(lindner)
> lindner.ps <- glm(abcix ~ stent + height + female +
+ diabetic + acutemi + ejecfrac + ves1proc,
+ data = lindner, family = binomial)
> ps<-lindner.ps$fitted
> lindner.cv <- lindner[,4:10]
> cv.bal.psa(lindner.cv, abcix, ps, strata = 5)
> cv.bal.psa(lindner.cv, abcix, ps, strata = 10)
> cv.bal.psa(lindner.cv, abcix, ps, int = c(.2, .5, .6, .75, .8))
>
>
>
>
>
> dev.off()
null device
1
>