I'm using gtsummary::tbl_uvregression to construct a univariate regression table modeled with geepack::geeglm.
Some variables contain NA values that are breaking the GEE models in the table.
x There was an error constructing model
geepack::geeglm(formula = tts_participant ~ omb_race, data = ., family = poisson, id =School Name, corstr = "independence", scale.fix = TRUE)See error below. Error inmutate_cols(): ! Problem withmutate()columnmodel. imodel = map(...). x Error in geese.fit(xx, yy, id, offset, soffset, w, waves = waves, zsca, : nrow(zsca) and length(y) not match Caused by error: ! Error in geese.fit(xx, yy, id, offset, soffset, w, waves = waves, zsca, : nrow(zsca) and length(y) not match
You would generally set data = na.omit(data) for geepack::geeglm. However, I only want to remove NAs for the variables that I'm looking at in the table. na.action = na.omit does not work. I would like to avoid computing a gtsummary::tbl_uvregression table for each individual variable.
How do I instruct tbl_uvregression to remove the NAs only for the specific model being generated. Here is my attempt:
tbl_uvregression(
method = geepack::geeglm,
y = tts_participant,
include = -`School Name`,
method.args = list(
family = poisson,
data = na.omit(data),
#na.action = na.omit,
id = `School Name`,
corstr = "independence",
scale.fix = TRUE
),
exponentiate = TRUE,
add_estimate_to_reference_rows = FALSE
)
Thank you!