linogaliana / gravity

0 stars 0 forks source link

Issue using R package "gravity" #1

Open bhara033 opened 1 year ago

bhara033 commented 1 year ago

Hello Lino,

Hope you are doing well. I am reaching out to you about an issue I am facing with using your R package "gravity." I am trying to run a negative binomial regression using the function "fastglm.nb()." However, I am unable to find any documentation or examples on how to use it correctly. The call "?gravity::fastglm.nb()" in R studio produces an error:

Error in .helpForCall(topicExpr, parent.frame()) : no methods for ‘fastglm.nb’ and no documentation for it as a function

Could you please refer me to the documentation for your package? I would greatly appreciate it. Thank you for your time.

Kind Regards,

Suhas

linogaliana commented 1 year ago

Hi,

gravity is an old side project I had when working on gravity models. Unfortunately, it is quite far from what I am doing now and the library has not been maintened as well as not really finished because I had to shift to another project.

I have not tried to run code from gravity for a few years so I hope there has not been any breaking change in R since the time I developed the library.

Basically, fastglm.nb mimics the behavior of glm.nb function from MASS package. Instead of being based on stats::glm for the estimation, it is based on fastglm::fastglm function that is supposed to be faster and more efficient in terms of memory. The roxygen documentation I had prepared is here. The arguments are more or less the same than those of MASS::glm.nb and at the time I developed that package, I had a series of tests that were checking that output was the same than the one expected using MASS package.