Adding in option to run jackknife standard errors for gee_test (and testing this capability) #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR does the following:
use_jack_se
(default is FALSE) togee_test()
jackknife_se()
and helper functionupdate_model()
that compute jackknife standard errors, with an optional argument ofid
which calculates a clustered jackknife se estimator (this is appropriate for our gee test function)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 ansapply
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 toenviromtx
so that someone could decide when callingfit_mgx_model
whether they want sandwich or clustered jackknife standard errors based on the number of clusters.