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

Adding in option to run jackknife standard errors for gee_test (and testing this capability) #13

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

svteichman
Copy link
Collaborator

This PR does the following:

  • adds the argument use_jack_se (default is FALSE) to gee_test()
  • adds a function jackknife_se() and helper function update_model() that compute jackknife standard errors, with an optional argument of id which calculates a clustered jackknife se estimator (this is appropriate for our gee test function)
  • adds tests of these new functionalities

One thing to note is that this jackknife implementation is slow (when benchmarked against the jackknife standard errors from geepack::geeglm()), which makes sense because it relies on an sapply call instead of calling cpp code. I think this shouldn't be a problem because the use case is when there is large bias for sandwich se's for a small number of clusters (according to the comment in line 43-45 of "gee_test.R"). If this all looks good, next steps are probably to add in this option to enviromtx so that someone could decide when calling fit_mgx_model whether they want sandwich or clustered jackknife standard errors based on the number of clusters.

@svteichman svteichman merged commit 9016d74 into statdivlab:main Jun 5, 2024
3 checks passed
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