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

Incorrect McKelvey & Zavoina pseudo-R2 #133

Open
imbhe opened this issue Dec 18, 2023 · 0 comments
Open

Incorrect McKelvey & Zavoina pseudo-R2 #133

imbhe opened this issue Dec 18, 2023 · 0 comments

Comments

@imbhe
Copy link

imbhe commented Dec 18, 2023

I believe the implementation of the McKelvey & Zavoina pseudo-R2 is incorrect. The numbers seem to be far too low. The variance calculated as np.var(y_pred) should actually be the variance of the logit-probabilities. Compare, e.g., to the implementation in R using DescTools::PseudoR2:
y.hat <- predict(x, type = "link").
s2 <- switch(link, probit = 1, logit = pi^2/3, NA)
sse <- sum((y.hat - mean(y.hat))^2)
res["McKelveyZavoina"] <- sse/(n * s2 + sse)

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

No branches or pull requests

1 participant