We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am using tbl_regression() to report the result of a glm. The glm uses the subset argument to remove some unneeded data.
tbl_regression()
tbl_regression() is giving a warning. The results appear to be correct.
With an lm model, no warning is given.
set.seed(23) df <- data.frame( resp = rnorm(n = 60), pred = rep(c("A", "B"), 30), n = 1:60 ) mod1 <- glm(resp ~ pred, data = df[1:50, ]) # without subset argument mod2 <- glm(resp ~ pred, data = df, subset = n <= 50) # with subset # models should be the same identical(coef(mod1), coef(mod2)) #> [1] TRUE gtsummary::tbl_regression(mod1)
gtsummary::tbl_regression(mod2) #> Warning in tcm * w: longer object length is not a multiple of shorter object #> length
Created on 2024-12-23 with reprex v2.1.1
The text was updated successfully, but these errors were encountered:
Thanks for the post @richardjtelford !
This warning arises from the broom.helpers::tidy_plus_plus(). Do you mind posting the issue there, please? https://github.com/larmarange/broom.helpers
broom.helpers::tidy_plus_plus()
glm(mpg ~ gear, data = mtcars, subset = mpg < 30) |> broom.helpers::tidy_plus_plus() #> Warning in tcm * w: longer object length is not a multiple of shorter object #> length #> # A tibble: 1 × 17 #> term variable var_label var_class var_type var_nlevels contrasts #> <chr> <chr> <chr> <chr> <chr> <int> <chr> #> 1 gear gear gear numeric continuous NA <NA> #> # ℹ 10 more variables: contrasts_type <chr>, reference_row <lgl>, label <chr>, #> # n_obs <dbl>, estimate <dbl>, std.error <dbl>, statistic <dbl>, #> # p.value <dbl>, conf.low <dbl>, conf.high <dbl>
Sorry, something went wrong.
Thanks @richardjtelford !
No branches or pull requests
I am using
tbl_regression()
to report the result of a glm. The glm uses the subset argument to remove some unneeded data.tbl_regression()
is giving a warning. The results appear to be correct.With an lm model, no warning is given.
Created on 2024-12-23 with reprex v2.1.1
The text was updated successfully, but these errors were encountered: