Description Usage Arguments Details Value Author(s) See Also Examples
Plot covariate disitribution in treatment groups
1 2 3 4 5 6 7 | dist.plot(object, sel=NULL, treat=NULL, stratum.index=NULL,
match.index=NULL, plot.type=1, compare=FALSE, cat.levels=2,
plot.levels=5, label.match=NULL, label.stratum=c("Stratum","Original"),
with.legend=TRUE, legend.title=NULL, legend.cex=0.9, myoma=c(3,2,2,2),
mymar=c(5,4,1,2), width=0.5, xlim=NULL, ylim=NULL, col=NULL, las=1,
font.main=2, font=1, main=NULL, main.cex=1.2, sub.cex=0.9,
bar.cex=0.8, ...)
|
object |
an object of class 'pscore', 'stratified.pscore',
'stratified.data.frame', 'matched.pscore', 'matched.data.frame',
'matched.data.frames' or a data frame. If object class is 'pscore',
arguments |
sel |
a data frame or a vector of integers or strings indicating covariates to be plotted. The default is 'NULL', i.e. the complete data set is selected. |
treat |
an integer or a string describing the treatment indicator
in 'data' and 'data.matched', respectively, if |
stratum.index |
an integer or a string indicating the vector
containing the stratum indices in stratified data. No specification
is needed if |
match.index |
an integer or a string indicating the vector
containing the matching indices in data and in the matched data. No
specification is needed if |
plot.type |
an integer specifying the plot type. The default is
'1', i.e. means for continuous and frequencies for categorical
covariates are plotted as barplots separated by treatment. If
|
compare |
a logical value indicating whether the covariate distribution in the original data are plotted. |
cat.levels |
an integer. The default is '2', i.e. covariates with more than two different values are considered as continuous. |
plot.levels |
an integer. The default is '5', i.e. five cutpoints
are used to define histogram classes for continuous
covariates. Caution: The classification depends on the data
structure such that the class number used in the histogram may
differ from the statement in |
label.match |
a vector of two strings describing the labels for the original and the matched data. The default is 'NULL', i.e. c('Original', 'Matched') is used. |
label.stratum |
a string describing the labels for the stratum-specific data. |
with.legend |
a logical value indicating whether a legend is shown. |
legend.title |
a string indicating the legend title. The default
is 'NULL', i.e either covariate categories or treatment labels in
case of continuous covariates are given if |
legend.cex |
a numeric indicating the font size in the legend. |
myoma |
the size of outer margins, see |
mymar |
margins to be specified on the four sides of the plot,
see |
width |
an integer indicating bar widths. |
xlim |
a vector of integers of length two indicating limits for the x axis. |
ylim |
a vector of integers of length two indicating limits for
the y axis. It is only meaningful if |
col |
a vector of colors for bars or bar components. The vector
length should depend on the |
las |
a integer indicating the style of axis labels, see
|
font.main |
an integer indicating the font to be used for plot
main titles, see |
font |
an integer specifying the font to use for text, see
|
main |
a string indicating the main title for graphics. |
main.cex |
a numeric indicating the font size of main title. |
sub.cex |
a numeric indicating the font size of sub titles. |
bar.cex |
a numeric indicating the font size of bar titles. |
... |
further arguments for graphics. |
Propensity score methods aims to eliminate imbalances in covariate distributions between treatment groups. An important issue is to check those after stratification or matching.
The usage of dist.plot()
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.
dist.plot()
returns a list containing information for
graphics. The number and the manner of the list entries depends on
plot.type
and on the type of covariates to be plotted:
name.sel |
a string containing names of the selected covariates. |
sel |
a data frame containing the selected covariates labeled by 'name.sel'. |
name.treat |
a string indicating the name of the selected treatment variable. |
treat |
a vector containing the treatment variable labeled by 'name.treat'. |
name.stratum.index |
a string indicating the name of the selected stratum indices. |
stratum.index |
a vector containing the stratum variable labeled by 'name.stratum.index'. |
name.match.index |
a string indicating the name of the selected matching indices. |
match.index |
a vector containing the matching variable labeled by 'name.match.index'. |
var.cat |
a string indicating the names of categorical variables. |
var.noncat |
a string indicating the names of continuous variables. |
mean |
a list of length two including means of continuous
covariates separated by treatment. If |
frequency |
a list with length according to the number of
categorical covariates whereas the list elements depend on
|
breaks.noncat |
a list with length according to the number of
continuous covariates. The list entries are numerics indicating the
cutpoints of histogram classes. It is only available if
|
x.cat |
a list with length according to the number of categorical
covariates. It contains frequencies w.r.t. treatment with the lower
value, e.g., '0' or 'No', before stratification or matching. It is
only available if |
y.cat |
a list with length according to the number of categorical
covariates. It contains frequencies w.r.t. treatment with the upper
value, e.g., '1' or 'Yes', before stratification or matching. It is
only available if |
x.s.cat |
a list with length according to the number of
categorical covariates. It contains frequencies w.r.t. strata
(columns) and treatment with the lower value, e.g., '0' or 'No'
after stratification. If |
y.s.cat |
a list with length according to the number of
categorical covariates. It contains frequencies w.r.t. strata
(columns) and treatment with the upper value, e.g., '1' or 'Yes'
after stratification. If |
x.noncat |
a list with length according to the number of
continuous covariates. It contains frequencies in histogram classes
w.r.t. treatment with the lower value, e.g., '0' or 'No', before
stratification or matching. It is only available if
|
y.noncat |
a list with length according to the number of
continuous covariates. It contains frequencies in histogram classes
w.r.t. treatment with the upper value, e.g., '1' or 'Yes', before
stratification or matching. It is only available if
|
x.s.noncat |
a list with length according to number of continuous
covariates. It contains lists with frequencies in histogram classes
w.r.t. strata and treatment with the lower value, e.g., '0' or 'No',
after stratification. If |
y.s.noncat |
a list with length according to number of continuous
covariates. It contains lists with frequencies in histogram classes
w.r.t. strata and treatment with the upper value, e.g., '1' or
'Yes', after stratification. If |
Susanne Stampf susanne.stampf@usb.ch
barplot
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 31 | ## 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.plot <-
dist.plot(object = stu1.match,
sel = c("age"),
compare = TRUE,
plot.type = 2,
with.legend = FALSE)
## 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.plot <-
dist.plot(object = pride.strata,
sel = c("REGION", "AGE"),
plot.type = 1) ## default
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.