Get the resulting matches from a matchit
model object. This function allows the
user to extract the matches from the original dataset used in model building or from a new dataset
that has a matching set of key column(s) (id_cols
).
get_matches(object, model_frame, id_cols = NULL, newdata = NULL)
The 'matchit'
class model object
The 'data.frame'
class object used in creation of object
.
A string indicating the ID for the datset used in the call to matchit
.
This can be used in combination with newdata
to return the base dataset. Defaults to
NULL
.
A new data.frame
object to extract matched observations from. Used in
conjunction with id_cols
. Defaults to NULL
.
If newdata
is NULL
, a subset of model_frame
containing the rows
corresponding to the matched treatement and control observations with weights appended. If
newdata
is not NULL
, an equivalent subset of newdata
is returned.