From 49975ae0dfdfa7085908cd2c12339a12c7f1f96b Mon Sep 17 00:00:00 2001 From: Sarah Teichman Date: Thu, 6 Jun 2024 11:16:39 -0700 Subject: [PATCH] update formula given from `gee_test()` to `jackknife_se()` so that jackknife standard errors correctly work when `gee_test()` is called by `enviromtx::fit_mgx_model()` --- R/gee_test.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/gee_test.R b/R/gee_test.R index 4c0fdfb..0e18887 100644 --- a/R/gee_test.R +++ b/R/gee_test.R @@ -81,7 +81,9 @@ gee_test <- function(use_geeasy = TRUE, use_jack_se = FALSE, ...) { # get jackknife standard errors if needed if (use_jack_se) { - output[, 2] <- jackknife_se(object = gee_result, + gee_result_new <- gee_result + gee_result_new$call$formula <- eval(gee_result$call$formula, rlang::caller_env()) + output[, 2] <- jackknife_se(object = gee_result_new, dat = eval(cl$data, envir = rlang::caller_env())[the_reorder, ], id = eval(cl$id, envir = rlang::caller_env())[the_reorder]) }