ps.match(object, object.control=NULL, matched.by=NULL,
control.matched.by=matched.by, who.treated=1, treat=NULL,
name.match.index="match.index", ratio=1, caliper="logit", x=0.2,
givenTmatchingC=TRUE, bestmatch.first=TRUE, setseed=FALSE,
combine.output=TRUE)
object
is a
data frame including only treated or untreated observations,
respectively.object.control
. The default is
'matched.by'.treat
labels the 'treated' observations.object
and object.control
. If the
class of the input object is 'pscore', no specification is needed.x
of the
standard deviation of the logit of the matching variabcaliper
='logit'.object
and object.control
are given, 'data',
'data.matched' and 'match.index' are combined as data frames or a
vector, respectively. If 'FALSE', these values are returneps.match()
returns an object of class 'matched.pscore',
'matched.data.frame' or 'matched.data.frames' depending on the
class(es) of the input object(s) and combine.output
. If the
class of the input object is 'pscore', the output object inherits all
components from the input object. The following components are
available:name.match.index
. If the input object is a data frame, 'data'
are sorted by treatment. If object.control
is given and
combine.output
='FALSE', 'data' is a list of two data frames
corresponding to the input objects.combine.output
='FALSE', it is a list of
two vectors corresponding to the input objects.caliper
,
ratio
, who.treated
, givenTmatchingC
,
bestmatch.first
).pscore()
.glm
containing information
about the propensity score model fitted at last in pscore()
.pscore()
.name.pscore
.name.treat
. The caliper, i.e. the maximum distance between the estimated
propensity scores of treated and untreated observations to be matched
is generally defined as x
=0.2 of the standard deviation of the
(caliper
)=logit of the estimated propensity score.
If function pscore()
is previously used with default settings,
matched.by
has not to be specified. It is needed, if the
matching variable in data is not labeled by 'pscore'. Also
treat
has not to be specified, contrary to the case where one
or two data frames are given as input objects.
## 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)
Run the code above in your browser using DataLab