-
-
Notifications
You must be signed in to change notification settings - Fork 101
Closed
Labels
3 investigators ❔❓Need to look further into this issueNeed to look further into this issueWaiting for response 💌Need more information from people who submitted the issueNeed more information from people who submitted the issue
Description
Dear performance package authors,
thank you for developping the performance package.
Testing function 'r2_nagelkerke' I had an issue with the outcome.
The critical code line is: r2_nagelkerke <- r2cox/(1 - exp(-model$null.deviance/insight::n_obs(model)))
According to https://de.wikipedia.org/wiki/Pseudo-Bestimmtheitsma%C3%9F
the part (1 - exp(-model$null.deviance/insight::n_obs(model))) is wrong. The code should be something like
ll_null <- insight::loglikelihood(insight::null_model(model))
r2_nagelkerke <- r2cox/-expm1(2/insight::n_obs(model) * ll_null)
With best regards, Alex
Metadata
Metadata
Assignees
Labels
3 investigators ❔❓Need to look further into this issueNeed to look further into this issueWaiting for response 💌Need more information from people who submitted the issueNeed more information from people who submitted the issue