Description Usage Arguments Details Value Author(s) Examples
Apply statistical tests or calculate standardized differences for balance checks of covariate distributions between treatment groups
1 2 3 |
object |
an object of class 'stratified.pscore', 'stratified.data.frame', 'matched.pscore', 'matched.data.frame', 'matched.data.frames' or a data frame. |
sel |
a data frame or a vector of integers or strings indicating covariates to be checked. The default is 'NULL', i.e. all variables in the data are selected. |
treat |
an integer or a string indicating the treatment variable
in the data (and in the matched data if |
stratum.index |
an integer or a string indicating the vector
containing the stratum indices in the stratified data. No
specification is needed if |
match.index |
an integer or a string indicating the vector
containing matching indices in data and in matched data. No
specification is needed if |
method |
a string indicating the method used to decide about
covariate balance between treatment groups. The default is
'classical', i.e., |
cat.levels |
an integer indicating the maximal number of levels
of selected categorical covariates to consider them as
categorical. The default is '2', i.e., covariates with more than two
different values are considered as continuous. For example, cov1 and
cov2 has three and four levels, respectively. |
alpha |
an integer indicating the significance level (per cent) or the cutpoint at which the decision about balance or imbalance is made in case of standardized differences. |
equal |
a logical value. The default is 'TRUE', i.e. equally-sized weights are used to combine standard deviations of covariates in treatment groups for calculating standardized differences. If 'FALSE', weights are proportions of observations in treatment groups within data, matched data and strata. |
Propensity score methods aims to eliminate imbalances in covariate distributions between treatment groups. An important issue is to check those after stratification or matching. Statistical tests or standardized differences can be used for those balance checks.
The usage of ps.balance()
depends on the class of the input
object. If either ps.makestrata()
or ps.match()
are
previously used, treat
, match.index
and
stratum.index
are not needed, contrary to the case where the
input object is a data frame.
ps.balance()
returns an object of the same class as the input
object. The number and the manner of the values depends on the used
method
:
data |
a data frame containing the input data. |
data.matched |
a data frame limiting 'data' only to matched
observations. It is only available if |
name.stratum.index |
a string indicating the name of the selected
stratum variable. It is only available if |
stratum.index |
a numeric vector containing stratum indices
labeled by 'name.stratum.index'. It is only available if
|
intervals |
a vector of characters indicating intervals. It is
only available if |
stratified.by |
a string indicating the name of stratification
variable. It is only available if |
formula.pscore |
a formula describing formally the propensity
score model fitted at last in |
model.pscore |
an object of class |
name.pscore |
a string indicating the name of propensity score at
last estimated via |
pscore |
a numeric vector containing the estimated propensity score labeled by 'name.pscore'. |
name.treat |
a string indicating the name of the treatment variable. |
treat |
a numeric vector containing the treatment variable labeled by 'name.treat'. |
matched.by |
a string indicating the name of the matching
variable. It is only available if |
name.match.index |
a string indicating the name of the selected
matching variable. It is only available if |
match.index |
a numeric vector containing the matching indices
labeled by 'name.match.index' whereas '0' indicates 'no matching
partner found'. It is only available if |
match.parameters |
a list of matching parameters including
|
bal.test |
a list of elements describing the results for the performed balance checks.
|
Susanne Stampf susanne.stampf@usb.ch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## STU1
data(stu1)
stu1.ps <- pscore(data = stu1,
formula = therapie~tgr+age)
stu1.match <- ps.match(object = stu1.ps,
ratio = 2,
caliper = 0.5,
givenTmatchingC = FALSE,
matched.by = "pscore",
setseed = 38902)
stu1.balance <- ps.balance(object = stu1.match,
sel = c("tgr","age"),
method = "stand.diff",
alpha = 20)
## PRIDE
data(pride)
pride.ps <- pscore(data = pride,
formula = PCR_RSV~SEX+RSVINF+REGION+
AGE+ELTATOP+EINZ+EXT,
name.pscore = "ps")
pride.strata <- ps.makestrata(object = pride.ps,
breaks = quantile(pride.ps$pscore,
seq(0,1,0.2)),
stratified.ps = "ps")
pride.balance <- ps.balance(object = pride.strata,
sel = c(2:6),
method = "classical",
cat.levels = 4,
alpha = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.