alexpkeil1 / qgcomp

QGcomp (quantile g-computation): estimating the effects of exposure mixtures. Works for continuous, binary, and right-censored survival outcomes. Flexible, unconstrained, fast and guided by modern causal inference principles
32 stars 6 forks source link

Predict function not working #20

Closed alexpkeil1 closed 3 years ago

alexpkeil1 commented 3 years ago

using "predict" on a qgcomp object gives the following error for me:

>fitted_qgcomp = qgcomp.noboot(defect~., expnms=names(X), data = andata[,c(names(X), names(W), "defect")])
>predict.qgcompfit(fitted_qgcomp)
Error in UseMethod("predict") : 
  no applicable method for 'predict' applied to an object of class "data.frame"

Until this is fixed, a workaround is to explicitly call the qgcomp function that predicts: >qgcomp:::predict.qgcompfit(fitted_qgcomp)

alexpkeil1 commented 3 years ago

Fixed in most recent release on CRAN (v2.8.0)