Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/ps.makestrata.R
Stratification based on the estimated propensity score
1 2 | ps.makestrata(object, breaks=NULL, name.stratum.index="stratum.index",
stratified.by=NULL, ...)
|
object |
an object of class 'pscore' or a data frame. |
breaks |
an integer, a numeric vector or suitable |
name.stratum.index |
a string indicating the variable name containing the stratum indices. |
stratified.by |
an integer or a string indicating the stratification variable in data. The default is NULL, i.e. if the class of the input object is 'pscore', object value 'pscore' is automatically used. |
... |
further arguments passed to or from other methods. |
Stratification by the estimated propensity score groups observations with identical or similar estimated propensity score.
If function pscore()
is previously used with default settings,
stratified.by
has not to be specified. It is needed if the
stratification variable is not labeled by 'pscore'.
Several options for the argument breaks
are available. The
default is 'NULL', i.e. values of the stratification variable are
factorized and each factor correspond to a stratum. Using an integer,
the number of strata is specified. If a numeric vector is given, its
values indicate the stratum bounds.
ps.makestrata()
returns an object of class 'stratified.pscore'
or 'stratified.data.frame' depending on the class of the input
object. If the class of the input object is 'pscore', the output
object inherits all components from the input object. The following
components are available:
data |
a data frame containing the input data, extended by
column(s) including stratum indices labeled by
|
name.stratum.index |
a string indicating the name of the variable containing the stratum indices, generated at last. |
stratum.index |
a numeric vector containing the stratum indices labeled by 'name.stratum.index'. |
intervals |
a vector of characters indicating intervals
corresponding to |
stratified.by |
a string indicating the name of the stratification variable. |
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 the propensity
score estimated at last in |
pscore |
a numeric vector containing the estimated propensity score labeled by 'name.pscore'. |
name.treat |
a string indicating the name of treatment used. |
treat |
a numeric vector containing treatment labeled by 'name.treat'. |
Susanne Stampf susanne.stampf@usb.ch
cut, quantile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## STU1
data(stu1)
stu1.ps <- pscore(data = stu1,
formula = therapie~tgr+age)
stu1.strata <- ps.makestrata(object = stu1.ps)
## 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")
|
Loading required package: lme4
Loading required package: Matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.