Replies: 2 comments 3 replies
-
|
For calculating the risk difference with a binary endpoint, I think it would be good to use family = binomial(link = "identity") rather than the Poisson distribution currently used in the code. This approach aligns with recommendations discussed (https://stats.stackexchange.com/questions/198439/are-there-any-reasons-to-use-the-identity-link-in-logistic-regression-or-any-ot). |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Hi Huaiyu, the issue here again is that family = binomial(link = "identity") doesn't work in R |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How to estimate risk ratio/risk difference? I did a quick search.
risk ratio: looks like log link doesn't work? i.e. family = binomial(link = "log))
instead uses poisson with log link and find standard error via sandwich package/bootstrap
see: https://ai-abdelaziz.com/posts/risk-ratio-regression/
risk difference: looks like you fit a regular logistic regression with logit link, predict the probabilities and subtract them.. standard error is found by bootstrap
see: https://www.r-bloggers.com/2021/06/estimating-a-risk-difference-and-confidence-intervals-using-logistic-regression/
Alternate way to calculate is maybe via using marginaleffects library
see: https://stats.stackexchange.com/questions/606524/calculate-risk-ratio-with-ci-in-r-from-odds-ratios
There seems to be even a R package called risks that does this..
see: https://cran.r-project.org/web/packages/risks/risks.pdf
Beta Was this translation helpful? Give feedback.
All reactions