prediction icon indicating copy to clipboard operation
prediction copied to clipboard

Add Support for Additional Model Classes

Open leeper opened this issue 7 years ago • 2 comments

This is a list of requested model classes to potentially support in prediction. It is sorted by completion status of model support, and then by function name. In order to support a model class, the package needs to provide a predict() method. If this is not provided, it is not (presently) supportable.

Supported

  • [x] arm::bayesglm() (inherits from "glm")
  • [x] aod::betabin(), aod::negbin(), aod::quasibin(), aod::quasipois(),
  • [x] betareg::betareg() (class "betareg"), with predict() method (but no se.fit arg)
  • [x] biglm::biglm() and biglm::bigglm()
  • [x] brglm::brglm() (inherits from "glm")
  • [x] mda::bruto()
  • [x] ordinal::clm()
  • [x] crch censored/truncated regression methods (#4)
  • [x] earth::earth()
  • [x] mda::fda()
  • [x] gam::gam()
  • [x] kernlab::gausspr()
  • [x] gee::gee()
  • [x] stats::glm()
  • [x] glmnet::glmnet()
  • [x] glmx::glmx() (class "glmx")
  • [x] MASS::glm.nb() (inherits from "glm")
  • [x] glmx::hetglm() (class "hetglm")
  • [x] pscl::hurdle()
  • [x] AER::ivreg()
  • [x] caret::knnreg()
  • [x] kernlab::kqr()
  • [x] kernlab::ksvm()
  • [x] MASS::lda()
  • [x] stats::lm()
  • [x] lme4 (lmer(), glmer(), ...) (but lme4:::predict.merMod() has no se.fit argument)
  • [x] nlme
    • nlme:::predict.lme() has no se.fit or type arguments
    • nlme:::predict.gls() has no se.fit argument.
  • [x] stats::loess() (predict() method uses se rather than se.fit)
  • [x] MASS::lqs()
  • [x] mda::mars()
  • [x] MASS::mca()
  • [x] mclogit::mclogit() (class "mclogit"), which is basically "glm"
  • [x] mda::mda()
  • [x] mlogit::mlogit()
  • [x] mnlogit::mnlogit()
  • [x] MNP::mnp()
  • [x] nnet::multinom() or any nnet model generally
  • [x] e1071::naiveBayes()
  • [x] nls (requires setting model = TRUE in original call; and then getting term(object[["model"]]))
  • [x] MASS::polr() (has predict() method with type = c("class", "probs"))
    • [x] arm::bayespolr() (covered by general "polr" method)
  • [x] mda::polyreg()
  • [x] caret::predict()
  • [x] MASS::qda()
  • [x] quantreg::rq()
  • [x] rpart::rpart()
  • [x] sampleSelection::selection() (class "select")
  • [x] speedglm::speedglm() and speedglm::speedlm()
  • [x] survival::survreg()
    • coxph class has different type values for predict(): c("lp", "risk", "expected")
  • [x] survey::svyglm()
  • [x] AER::tobit()
  • [x] truncreg::truncreg()
  • [x] pscl::zeroinfl()

Potentially supportable

  • [ ] bamlss::bamlss()
  • [ ] dynlm::dynlm()
  • [ ] gnm::gnm()
  • [ ] LARF::larf()
  • [ ] bbmle::mle2()
  • [ ] mpt::mpt()
  • [ ] np (non-parametric regression)
  • [ ] rms
  • [ ] "stanreg" objects from rstanarm
  • [ ] VGAM::vglm()
  • [ ] mgcv::bam()
  • [ ] mgcv::gam()
  • [ ] gamlss::gamlss()
  • [ ] mgcv::gamm()
  • [ ] VGAM::vgam()
  • [ ] spdep
  • [ ] sphet::spreg()
  • [ ] splm::spml()
  • [ ] splm::spgm()

Not currently supportable

  • [ ] censReg (has a margEff() generic but no predict() method)
  • [ ] ordinal::clmm() (no predict() method)
  • [ ] lfe::felm() (no predict() method)
  • [ ] dispmod: lm.disp(), glm.binomial.disp(), glm.poisson.disp() (no predict() method)
  • [ ] geepack: geeglm(), geese(), ordgee() (no predict() methods)
  • [ ] ghyp (ORPHANED)
  • [ ] gmm::gmm() (no predict() method)
  • [ ] gmnl::gmnl() (no predict() method)
  • [ ] GeneralizedHyperbolic::hyperblm() (no predict() method)
  • [ ] ivprobit::ivprobit() (no predict() method)
  • [ ] class::knn() (does not construct a model object)
  • [ ] sem::tsls() (no predict() method)
  • [ ] plm::plm() (non-exported predict method)
  • [ ] plm::pglm()
  • [ ] survey::svyolr() (no predict() method)

(Note: this is migrated from: https://github.com/leeper/margins/issues/3)

leeper avatar Oct 30 '16 12:10 leeper

@leeper I'd add the other survey package functions. While many of them are based on survey::svyglm() which are class glm, lm, and svyglm, the survey::svyolr() function is NOT from MASS::polr() and is of class svyolr.

bgall avatar May 25 '17 23:05 bgall

For models produced by plm::plm(), there is a predict method available since plm version 2.6-2.

tappek avatar Aug 19 '22 11:08 tappek