markmfredrickson / optmatch

Functions for optimal matching in R
https://markmfredrickson.github.io/optmatch
Other
47 stars 14 forks source link

Issue194 survey #208

Closed benthestatistician closed 3 years ago

benthestatistician commented 3 years ago

Survey support is trickier than I had hoped. I find that having an exported model.frame.svyglm() creates unwanted side effects in calculations unrelated to optmatch. These commits may or may not fix the various troubles with survey functions, but they revert the exporting of model.frame.svyglm(), which seems to have been a mistake to begin with.

benthestatistician commented 3 years ago

@markmfredrickson, the remaining conflict has to do with our different accommodation of the newsvyquantile in recent versions of the survey package:

<<<<<<< issue194-survey
        med <- svyquantile(~x, design, 0.5)[[1]][1]
=======
        med <- as.vector(survey::svyquantile(~x, design, 0.5))$x[1]
>>>>>>> master

Mine may be a bit more back-compatible, but in light of the new requirement of a recent survey package that's probably idle.

markmfredrickson commented 3 years ago

@markmfredrickson, the remaining conflict has to do with our different accommodation of the newsvyquantile in recent versions of the survey package:

<<<<<<< issue194-survey
        med <- svyquantile(~x, design, 0.5)[[1]][1]
=======
        med <- as.vector(survey::svyquantile(~x, design, 0.5))$x[1]
>>>>>>> master

Mine may be a bit more back-compatible, but in light of the new requirement of a recent survey package that's probably idle.

I'm happy with either. The primary goal of my solution was to get the errors to stop so that outmatch would not get removed from CRAN. There may be good reasons to prefer your implementation.

benthestatistician commented 3 years ago

Hi @markmfredrickson, passing this back to you.