-
Notifications
You must be signed in to change notification settings - Fork 1
Description
If you use the vignette("average-trend") and change from inla to lm it fails.
df <- ghost::gho_data("BP_04", query = "$filter=Dim1 eq 'MLE' and Dim2 eq 'YEARS18-PLUS'") %>%
billionaiRe::wrangle_gho_data() %>%
dplyr::right_join(covariates_df) %>%
dplyr::select(iso3, year, year_n, value) %>%
dplyr::filter(whoville::is_who_member(iso3), # keep WHO member states
year >= 2000, year <= 2023) %>% # get relevant years
dplyr::mutate(who_region = whoville::iso3_to_regions(iso3))
pred_df <- df %>%
predict_lm_avg_trend(formula = value ~year_n,
average_cols = c("who_region", "year_n"),
group_models = TRUE,
group_col = "iso3",
sort_col = "year_n")
The error is Error: Must group by variables found in .data.
- Column
iso3is not found.
This also occurs for glm and lmer average functions and probably others.
For lm I tracked the bug as far as augury:::fit_general_average_model
but am not sure if the issue is the arguments or the function.