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, ...)
stratum.index
or match.index
ps.match()
is
previously used. If the class of the input object is
'stratified.pscore' or 'matched.pscore', no specification ps.makestrata()
is previously used.ps.match()
is previously used.plot.type
='2', histograms are shown.plot.type
='1'. For
plot.type
='2', treatment labels are shopar
.par
.plot.type
='2'.plot.type
and the category levels
of the plotted covariates.par
.par
.par
.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:compare
='FALSE', list
elements are matrices with means separated by treatment (rows) and
strata or matched/unmatched data (columns), respectively. If
compare
='TRUE', the list elements are lists including means
before (first list element) and after (second list element)
stratification or matching. The order of list elements is in
accordance to the order of 'var.noncat'. It is only available if
plot.type
=1.compare
. If compare
='FALSE', list elements contain
standardized frequency tables separated by treatment (rows) and by
strata or by matched/unmatched data (columns). The order and the
number of list elements is w.r.t. 'var.cat'. If
compare
='TRUE', there are two list elements which are lists
of frequency tables. The first list element contains lists of
frequency tables separated by treatment before stratification or
matching and the second list element includes lists of frequency
tables separated by treatment and strata or matched/unmatched
data. The order of list elements is in accordance to the order of
'var.cat'. It is only available if plot.type
=1.plot.type
=2.plot.type
=2 and compare
='TRUE'.plot.type
=2 and compare
='TRUE'.match.index
is used, frequencies are
given w.r.t. treatment with the lower value and w.r.t. the original
data (first column) and the matched data (second column). It is only
available if plot.type
=2.match.index
is used, frequencies are
given w.r.t. treatment with the upper value and w.r.t. the original
data (first column) and the matched data (second column). It is only
available if plot.type
=2.plot.type
=2 and compare
='TRUE'.plot.type
=2 and compare
='TRUE'.match.index
is used, frequencies in
histogram classes are given w.r.t. treatment with the lower value
and w.r.t. the original data and the matched dats. It is only
available if plot.type
=2.match.index
is used,
frequencies in histogram classes are given w.r.t. treatment with the
upper value and w.r.t. the original data and the matched dats. It is
only available if plot.type
=2.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.## 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
Run the code above in your browser using DataLab