lhvanegasp / glmtoolbox

0 stars 0 forks source link

A kind request to consider supporting the Author of the marginaleffects package on the ntegration with the glmtoolbox package #3

Closed adrianolszewski closed 1 day ago

adrianolszewski commented 1 month ago

Dear Professor @lhvanegasp

I understand you are very busy. It would be so good to make your awesome package more popular and integrated with other existing and popular "ecosystems"!

Therefore I would like to very kindly ask you, it possible, to have a glance at this topic in the "marginaleffects" package site and maybe support a little the Author (@vincentarelbundock ) of this great framework for marginal effects?

https://github.com/vincentarelbundock/marginaleffects/issues/1148

It would be a real pity to leave your generous and excellent work unknown to many potential users!

vincentarelbundock commented 1 month ago

FYI, this should not require intervention directly from the glmtoolbox author. Users --- like you --- can help in major ways to bring support into marginaleffects. See the detailed instructions here: https://marginaleffects.com/vignettes/extensions.html

lhvanegasp commented 1 month ago

Dear @adrianolszewski Similar to what happened with the "broom" package (tidiers), I will write the extension for the "marginaleffects" package and then I will submit the results to @vincentarelbundock.

lhvanegasp commented 1 month ago

Dear @adrianolszewski and @vincentarelbundock

The following are my versions of get_coef(), set_coef(), get_vcov() and get_predict() for the glmgee-type objects. Please let me know your comments.

get_coef.glmgee <- function(model, ...) { b <- model$coefficients b <- setNames(as.vector(b), row.names(b)) return(b) }

set_coef.glmgee <- function(model, coefs, ...) { out <- model out$coefficients <- coefs return(out) }

get_vcov.glmgee <- function(model, ...,type=c("robust","df-adjusted","model","bias-corrected","jackknife")) { type <- match.arg(type) return(vcov(model,type=type)) }

get_predict.glmgee <- function(model, newdata, ...) { Yhat <- predict(model,newdata=newdata,type="response") out <- data.frame( rowid = seq_len(nrow(Yhat)), estimate = as.vector(Yhat)) return(out) }

vincentarelbundock commented 2 weeks ago

Thanks for this. Very helpful!

I made a few tweaks and merged support for glmtoolbox::glmgee() into the development main branch of marginaleffects on Github. This will be part of the CRAN release coming in the coming days.

lhvanegasp commented 2 weeks ago

Thanks You very much

adrianolszewski commented 1 day ago

I thank you both wholeheartedly for taking your time for this awesome example of cooperation! Please accept my deepest gratitude. I think this issue can be closed now.