Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Poisson glm to estimate growth rate #74

Closed
ffinger opened this issue Apr 30, 2020 · 3 comments · Fixed by #86
Closed

Using Poisson glm to estimate growth rate #74

ffinger opened this issue Apr 30, 2020 · 3 comments · Fixed by #86

Comments

@ffinger
Copy link

ffinger commented Apr 30, 2020

Thanks for all the amazing work you are doing!

I just wanted to make you aware of a discussion regarding the estimation of growth rate and doubling time we had with @patrickbarks.

The way it is estimated here currently (and the way I have used for previous projects) is to use a log-linear model (linear model similar to lm(log(incidence) ~ date). For the log to work you need to remove the 0s or replace them with a small positive value.

A better way to estimate the growth rate would be to use a Poisson glm of the incident cases (glm(incidence ~ date, family = poisson()) or similar). In addition to the more appropriate error model for count data this can handle 0s in the data natively.

Here are some references:
https://bmcmedinformdecismak.biomedcentral.com/articles/10.1186/1472-6947-12-147#additional-information
https://besjournals.onlinelibrary.wiley.com/doi/10.1111/j.2041-210X.2010.00021.x

And here is how this is done in the R0 package (https://github.com/cran/R0/blob/master/R/est.R0.EG.R):

  # Method 2 == Poisson regression
  else if (reg.met == "poisson") {
    #tmp <- glm(incid ~ t.glm, family=poisson(), data=epid)
    tmp <- glm(incid ~ t, family=poisson(), data=epid)
    Rsquared = (tmp$null.deviance-tmp$deviance)/(tmp$null.deviance)
    r <- coefficients(tmp)[2]
    confint = confint(tmp)[2,]
    pred= predict(tmp,type="response")
  }
@seabbs
Copy link
Contributor

seabbs commented May 5, 2020

Thanks for this @ffinger really good point.

I have addressed (by a straight conversion to the suggested Poisson) in 4303daa - does everything there look okay to you? Outside of this fn bootstrapping assuming normality so maybe need to change that as well?

What do you think about the justification for using Poisson over QuasiPoisson or Negative binomial here?

Thanks again - Sam

@ffinger
Copy link
Author

ffinger commented May 5, 2020

I have addressed (by a straight conversion to the suggested Poisson) in 4303daa - does everything there look okay to you? Outside of this fn bootstrapping assuming normality so maybe need to change that as well?

Looks good to me, yes.
I don't see a reason why not to use Poisson for the bootstrapping too. It's discrete though, but I don't think that should impact your CI's. If the mean is high enough it won't have a big impact since you Poisson is reasonably approximated by a normal.

What do you think about the justification for using Poisson over QuasiPoisson or Negative binomial here?

Agreed that overdispersion is likely, so certainly a good point. I don't know enough to be able to tell the advantage of each, other than that quasipoisson() is a family available in glm whereas for a Negative Binomial you need to use a specific package. The way overdispersion is parametrized among the two is different, and quasipoisson doesn't give you a proper likelihood, which I don't think is an issue in your application.

@thibautjombart, any specific reason you choose quasipoisson over NegBin for your application?

@seabbs
Copy link
Contributor

seabbs commented May 5, 2020

Switched to Quasipoisson as I think no reason not to use it.

@seabbs seabbs linked a pull request May 5, 2020 that will close this issue
@seabbs seabbs closed this as completed in #86 May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants