GithubHelp home page GithubHelp logo

The default regression argument of zepid.base.interaction_contrast_ratio differs from the description in the documentation. about zepid HOT 4 OPEN

singledoggy avatar singledoggy commented on June 18, 2024
The default regression argument of zepid.base.interaction_contrast_ratio differs from the description in the documentation.

from zepid.

Comments (4)

pzivich avatar pzivich commented on June 18, 2024 1

No problem! But I am going to re-open this issue since I do need to fix the misalignment in the documentation and the actual defaults.

To go into a little more detail in case it is helpful for you (or others who come across this thread), the ICR is a measure to assess effect measure modification for the risk ratio. In epidemiology, the risk ratio is the probability of the outcome among one group divided by the probability of the outcome among the other group. In this case, the risk ratios are estimated for each exposure-modifier combination. One way to estimate these risk ratios is to use a log-binomial model. This is the method used in the background. Essentially, I use a generalized linear model to estimate the risk ratios that make up the ICR and then compute the ICR for the user.

The disadvantage of the log-binomial model is that it can sometimes not converge well. statsmodels throws a DomainWarning when you try to fit this model. This is because the risk ratio is bounded on one side, which the generalized linear model doesn't incorporate. So, the log-binomial model can fail to converge in some cases.

This is different from the logit-binomial model (or logistic regression). Logistic models don't have the same bounding issue and are much easier to converge. The issue that occurs with the use of logistic regression is that it estimates the odds ratio. Since the ICR is defined for the risk ratio, there is a problem that occurs when trying to estimate the ICR using logistic regression. However, the odds ratio approximates the risk ratio for 'rare' events (rare is usually something like <10%). So, I included using the logistic model as an option but have the warning to remind the user of the assumption being made.

Hope this all helps!

from zepid.

pzivich avatar pzivich commented on June 18, 2024

The docs are misaligned as you mention. I believe the default was set to logit since the logit-bin model tends to converge better. However it does have the additional assumption of the OR approximating the RR.

The default is probably better as log since that is the original scale for the ICR.

from zepid.

singledoggy avatar singledoggy commented on June 18, 2024

Thank you for your prompt response. I am not well-versed in the field of epidemiology, as I am currently attempting to apply this concept to a different area. As a result, I am unfamiliar with the distinctions between these two models. Your explanation has greatly clarified the matter for me.

from zepid.

singledoggy avatar singledoggy commented on June 18, 2024

Thank you very much for providing the additional information. It is very helpful to me.

from zepid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.