Comments (7)
tested added and fixed
from broom.helpers.
Am I missing something? I think this issue remains? The "factor(response):marker"
variable is still showing on two lines.
remotes::install_github("larmarange/broom.helpers")
#> Using github PAT from envvar GITHUB_PAT
#> Skipping install of 'broom.helpers' from a github remote, the SHA1 (013085ed) has not changed since last install.
#> Use `force = TRUE` to force installation
library(broom.helpers)
library(gtsummary)
lm(age ~ factor(response) * marker, trial) %>%
tidy_and_attach() %>%
tidy_identify_variables() %>%
tidy_add_reference_rows() %>%
tidy_add_variable_labels() %>%
tidy_add_header_rows(show_single_row = "factor(response):marker") %>%
knitr::kable()
term | variable | var_label | var_class | var_type | header_row | contrasts | reference_row | label | estimate | std.error | statistic | p.value |
---|---|---|---|---|---|---|---|---|---|---|---|---|
(Intercept) | NA | (Intercept) | NA | intercept | NA | NA | NA | (Intercept) | 43.985685 | 1.906507 | 23.071342 | 0.0000000 |
NA | factor(response) | factor(response) | factor | categorical | TRUE | contr.treatment | NA | factor(response) | NA | NA | NA | NA |
factor(response)0 | factor(response) | factor(response) | factor | categorical | FALSE | contr.treatment | TRUE | 0 | NA | NA | NA | NA |
factor(response)1 | factor(response) | factor(response) | factor | categorical | FALSE | contr.treatment | FALSE | 1 | 9.117623 | 3.536300 | 2.578294 | 0.0107814 |
marker | marker | Marker Level (ng/mL) | numeric | continuous | NA | NA | NA | Marker Level (ng/mL) | 2.007188 | 1.609824 | 1.246836 | 0.2141828 |
NA | factor(response):marker | factor(response) * Marker Level (ng/mL) | NA | interaction | TRUE | NA | NA | factor(response) * Marker Level (ng/mL) | NA | NA | NA | NA |
factor(response)1:marker | factor(response):marker | factor(response) * Marker Level (ng/mL) | NA | interaction | FALSE | NA | NA | 1 * Marker Level (ng/mL) | -5.337195 | 2.647510 | -2.015930 | 0.0453914 |
Created on 2020-09-03 by the reprex package (v0.3.0)
from broom.helpers.
Oupsssss
OK I added a tests without adding reference row but I forgot a test sith reference row (because this is two different cases)!!!
Should be fixed by 5ee5781
from broom.helpers.
Fantastic! (I see that I added bad code the with the check for bad_single_row
check..sorry! 😭 )
For the interaction handling, I think the label column should be equal to the variable label instead of the previous label that includes reference to the variable level ("factor(response) * Marker Level (ng/mL)"
instead of "1 * Marker Level (ng/mL)"
).
library(broom.helpers)
lm(age ~ trt + factor(response) * marker, gtsummary::trial) %>%
tidy_and_attach() %>%
tidy_remove_intercept() %>%
tidy_identify_variables() %>%
tidy_add_reference_rows() %>%
tidy_add_variable_labels() %>%
tidy_add_header_rows(show_single_row = c("factor(response):marker", "trt")) %>%
dplyr::select(any_of(c("variable", "var_label", "var_type", "header_row",
"reference_row", "label", "estimate"))) %>%
knitr::kable()
variable | var_label | var_type | header_row | reference_row | label | estimate |
---|---|---|---|---|---|---|
trt | Chemotherapy Treatment | categorical | NA | FALSE | Chemotherapy Treatment | 0.5592142 |
factor(response) | factor(response) | categorical | TRUE | NA | factor(response) | NA |
factor(response) | factor(response) | categorical | FALSE | TRUE | 0 | NA |
factor(response) | factor(response) | categorical | FALSE | FALSE | 1 | 9.1100225 |
marker | Marker Level (ng/mL) | continuous | NA | NA | Marker Level (ng/mL) | 2.0504401 |
factor(response):marker | factor(response) * Marker Level (ng/mL) | interaction | NA | NA | 1 * Marker Level (ng/mL) | -5.3656455 |
Created on 2020-09-03 by the reprex package (v0.3.0)
from broom.helpers.
OK code changed to also cover interaction terms
from broom.helpers.
Last question: do we need to flag those lines and to add a single_row
column?
Or no need for that?
from broom.helpers.
I don't think there is a need for that...I can't see how it would be used....... 🤔
from broom.helpers.
Related Issues (20)
- Support for mmrm models HOT 8
- Support for MASS::contr.sdif() contrasts
- Support for zero-inflated models
- beta regression is not supported yet HOT 2
- Considering a `tidy_post_fun` argument to `tidy_plus_plus()` HOT 2
- Support with coxphf model HOT 9
- Bug fixes and improvements for mixed models HOT 1
- tbl_regression (package gtsummary) and ggcoef_model (package ggstats) not working on the output of a replicate svyglm model HOT 2
- fantastic support of multivariate quantile regression for any quantile HOT 1
- Support for survival::cch model? HOT 5
- Avg_comparisons and nlme::lme() models HOT 1
- order of variable levels with marginal tidiers HOT 8
- Release broom.helpers 1.15.0
- Take into account (id) when computing model_get_n() for coxph models
- `marginaleffects::datagridcf()` is deprecated
- Do you know the status of the {margins} pkg? HOT 3
- Explore better support of VGAM::vglm() models HOT 1
- Execution time HOT 4
- marginaleffects::datagridcf() is deprecated
- pkgdown site has no search facility HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from broom.helpers.