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

bug in augury in predict_lm_avg_trend. #23

Open
alicerobson opened this issue Oct 7, 2021 · 0 comments
Open

bug in augury in predict_lm_avg_trend. #23

alicerobson opened this issue Oct 7, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@alicerobson
Copy link

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 iso3 is 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.

@ElliottMess ElliottMess added the bug Something isn't working label Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants