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

implement penalized likelihood ratio tests to calculate p-values #2

Merged
merged 10 commits into from
Jun 26, 2022
Merged

Conversation

jzluo
Copy link
Owner

@jzluo jzluo commented Jun 26, 2022

In logistf, likelihood ratio test statistics are not calculated by excluding the parameter being tested when fitting the null model. Instead the coefficient is constrained to zero such that it still contributes to the penalization (see https://stats.stackexchange.com/questions/555971/calculation-of-p-values-in-logistf-package)

In the logistf code, it seems this is done in the calculation of XW^(1/2), going by where selcol appears. So I implemented a masking in _get_XW().

There's some minor discrepancies in the p-values compared to logistf. Need to look into that but it's fine for now.

package Intercept age oc vic vicl vis dia
logistf 8.020268e-01 6.143472e-03 8.751911e-01 1.678877e-06 1.237805e-05 5.449701e-02 4.951873e-03
firthlogist 7.66583794e-01 6.11138932e-03 8.26365363e-01 1.67218633e-06 1.23618050e-05 5.34899080e-02 4.84687363e-03

@jzluo jzluo merged commit 142b574 into master Jun 26, 2022
@jzluo jzluo deleted the lrt branch June 26, 2022 23:16
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 this pull request may close these issues.

1 participant