Skip to content

Use supplied vmat in FDR-adjusted Johnson-Neyman intervals - #88

Open
chenyangsu wants to merge 1 commit into
jacob-long:masterfrom
chenyangsu:fix/jn-fdr-vmat
Open

chenyangsu wants to merge 1 commit into
jacob-long:masterfrom
chenyangsu:fix/jn-fdr-vmat

Conversation

@chenyangsu

Copy link
Copy Markdown

Calling johnson_neyman(fit, pred = hp, modx = wt, vmat = 4 * vcov(fit), control.fdr = TRUE) on lm(mpg ~ hp * wt, data = mtcars) returns t_value = 2.3344 (matching vmat = NULL) instead of 2.5136. In johnson_neyman.default(), the Esarey & Sumner (2017) FDR step calls vcov(model) instead of vmat, while the bounds and confidence bands below use vmat.

Use vmat when supplied in the FDR calculation, with regression tests in tests/testthat/test-jn-fdr-vmat.R. Happy to move these tests into test_sim_slopes.R if you prefer.

Testing: devtools::test() -> 405 passed, 0 failed, 6 skipped.

This branch has not been deployed

No deployments
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