Check for "matched.distances" attribute, and when not found just omit this aspect of report.
Add a new argument "xbal.control", or something along those lines, either NULL (default) or a list of arguments to be passed to xBalance. (Replacing what's currently in the ...)
Remove "propensity.model" argument. Instead, accept fitted models and other things in the ... slot.
For any object passed as a ..., attempt to return a summary of the matched distances such as the one currently being returned. Do this by applying match_on to the object, then matched.distances to whatever comes out of that. Note that this may result in multiple summaries of matched distances.
For any object passed as a ... that is also a glm, return balance info. Note that this may result in multiple balance summaries, or none.
Rationale: In light of #57, summary.optmatch should not necessarily expect optmatch objects to carry a "matched.distances" attribute. On the other hand, there are situations when the summary should include matched distances information regarding distances other than the distance actually used to produce the match. In particular, the usage summary(my_match, my_PS_model) ought to be returning distances on the score inside of my_PS_model.
xBalance
. (Replacing what's currently in the ...)match_on
to the object, thenmatched.distances
to whatever comes out of that. Note that this may result in multiple summaries of matched distances.glm
, return balance info. Note that this may result in multiple balance summaries, or none.Rationale: In light of #57,
summary.optmatch
should not necessarily expect optmatch objects to carry a "matched.distances" attribute. On the other hand, there are situations when the summary should include matched distances information regarding distances other than the distance actually used to produce the match. In particular, the usagesummary(my_match, my_PS_model)
ought to be returning distances on the score inside ofmy_PS_model
.