Comments (5)
Experimental support has been added to PR #243
Please note that you need to indicate exponentiate = TRUE
from broom.helpers.
Fantastic, thank you for such a quick update @larmarange!
from broom.helpers.
I re-ran the test example, and it looks like even with exponentiate = TRUE, the values displayed on the table are the un-exponentiated values. Would you mind please looking into this whenever you have a chance? Thank you!
library(survival)
#> Warning: package 'survival' was built under R version 4.1.3
library(gtsummary)
#> Warning: package 'gtsummary' was built under R version 4.1.3
# case-cohort model using the survival::cch function
# example from survival::cch()
## The complete Wilms Tumor Data
## (Breslow and Chatterjee, Applied Statistics, 1999)
## subcohort selected by simple random sampling.
##
subcoh <- nwtco$in.subcohort
selccoh <- with(nwtco, rel==1|subcoh==1)
ccoh.data <- nwtco[selccoh,]
ccoh.data$subcohort <- subcoh[selccoh]
## central-lab histology
ccoh.data$histol <- factor(ccoh.data$histol,labels=c("FH","UH"))
## tumour stage
ccoh.data$stage <- factor(ccoh.data$stage,labels=c("I","II","III","IV"))
ccoh.data$age <- ccoh.data$age/12 # Age in years
##
## Standard case-cohort analysis: simple random subcohort
##
fit.ccP <- cch(Surv(edrel, rel) ~ stage + histol + age, data =ccoh.data,
subcoh = ~subcohort, id=~seqno, cohort.size=4028)
summary(fit.ccP)
#> Case-cohort analysis,x$method, Prentice
#> with subcohort of 668 from cohort of 4028
#>
#> Call: cch(formula = Surv(edrel, rel) ~ stage + histol + age, data = ccoh.data,
#> subcoh = ~subcohort, id = ~seqno, cohort.size = 4028)
#>
#> Coefficients:
#> Coef HR (95% CI) p
#> stageII 0.735 2.085 1.498 2.900 0.000
#> stageIII 0.597 1.817 1.293 2.552 0.001
#> stageIV 1.384 3.991 2.672 5.963 0.000
#> histolUH 1.498 4.473 3.271 6.117 0.000
#> age 0.043 1.044 0.997 1.094 0.068
# tidy model output: success
broom::tidy(fit.ccP)
#> # A tibble: 5 x 7
#> term estimate std.error statistic p.value conf.low conf.high
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 stageII 0.735 0.168 4.36 1.30e- 5 0.404 1.06
#> 2 stageIII 0.597 0.173 3.44 5.77e- 4 0.257 0.937
#> 3 stageIV 1.38 0.205 6.76 1.40e-11 0.983 1.79
#> 4 histolUH 1.50 0.160 9.38 0 1.19 1.81
#> 5 age 0.0433 0.0237 1.82 6.83e- 2 -0.00324 0.0898
# this now runs
broom.helpers::tidy_plus_plus(fit.ccP, exponentiate = TRUE) %>%
select(term, label, estimate)
#> # A tibble: 7 x 3
#> term label estimate
#> <chr> <chr> <dbl>
#> 1 stageI I 1
#> 2 stageII II 0.735
#> 3 stageIII III 0.597
#> 4 stageIV IV 1.38
#> 5 histolFH FH 1
#> 6 histolUH UH 1.50
#> 7 age age 0.0433
# however, the log(HR) is being displayed as the HR, and the exponentiation seems to not be working
# HR for stage II should be exp(0.74) = 2.08 based on summary(fit.ccP)
# gtsummary::tbl_regression(fit.ccP, exponentiate = TRUE)
Created on 2024-01-24 with reprex v2.0.2
Session info
sessioninfo::session_info()
#> - Session info ---------------------------------------------------------------
#> setting value
#> version R version 4.1.2 (2021-11-01)
#> os Windows 10 x64 (build 19045)
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate English_United States.1252
#> ctype English_United States.1252
#> tz America/New_York
#> date 2024-01-24
#> pandoc 3.1.1 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#>
#> - Packages -------------------------------------------------------------------
#> package * version date (UTC) lib source
#> backports 1.4.1 2021-12-13 [1] CRAN (R 4.1.2)
#> broom 1.0.5 2023-06-09 [1] CRAN (R 4.1.2)
#> broom.helpers 1.14.0.9000 2024-01-24 [1] local
#> cli 3.4.1 2022-09-23 [1] CRAN (R 4.1.3)
#> colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.1.3)
#> digest 0.6.30 2022-10-18 [1] CRAN (R 4.1.3)
#> dplyr 1.1.0 2023-01-29 [1] CRAN (R 4.1.3)
#> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.0.5)
#> evaluate 0.20 2023-01-17 [1] CRAN (R 4.1.3)
#> fansi 1.0.4 2023-01-22 [1] CRAN (R 4.1.3)
#> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.0.5)
#> forcats 1.0.0 2023-01-29 [1] CRAN (R 4.1.3)
#> fs 1.5.2 2021-12-08 [1] CRAN (R 4.1.3)
#> generics 0.1.3 2022-07-05 [1] CRAN (R 4.1.3)
#> ggplot2 3.4.1 2023-02-10 [1] CRAN (R 4.1.3)
#> glue 1.6.2 2022-02-24 [1] CRAN (R 4.1.2)
#> gt 0.8.0 2022-11-16 [1] CRAN (R 4.1.3)
#> gtable 0.3.1 2022-09-01 [1] CRAN (R 4.1.3)
#> gtsummary * 1.7.0 2023-01-13 [1] CRAN (R 4.1.3)
#> haven 2.5.2 2023-02-28 [1] CRAN (R 4.1.3)
#> hms 1.1.2 2022-08-19 [1] CRAN (R 4.1.3)
#> htmltools 0.5.3 2022-07-18 [1] CRAN (R 4.1.3)
#> knitr 1.42 2023-01-25 [1] CRAN (R 4.1.3)
#> labelled 2.10.0 2022-09-14 [1] CRAN (R 4.1.3)
#> lattice 0.20-45 2021-09-22 [1] CRAN (R 4.1.2)
#> lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.1.3)
#> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.1.3)
#> Matrix 1.5-3 2022-11-11 [1] CRAN (R 4.1.3)
#> munsell 0.5.0 2018-06-12 [1] CRAN (R 4.0.0)
#> pillar 1.8.1 2022-08-19 [1] CRAN (R 4.1.3)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.0)
#> purrr 1.0.1 2023-01-10 [1] CRAN (R 4.1.3)
#> R.cache 0.16.0 2022-07-21 [1] CRAN (R 4.1.3)
#> R.methodsS3 1.8.2 2022-06-13 [1] CRAN (R 4.1.3)
#> R.oo 1.25.0 2022-06-12 [1] CRAN (R 4.1.3)
#> R.utils 2.12.2 2022-11-11 [1] CRAN (R 4.1.3)
#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.1.1)
#> reprex 2.0.2 2022-08-17 [1] CRAN (R 4.1.3)
#> rlang 1.1.1 2023-04-28 [1] CRAN (R 4.1.2)
#> rmarkdown 2.23 2023-07-01 [1] CRAN (R 4.1.2)
#> rstudioapi 0.14 2022-08-22 [1] CRAN (R 4.1.3)
#> scales 1.2.1 2022-08-20 [1] CRAN (R 4.1.3)
#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.1.3)
#> stringi 1.7.6 2021-11-29 [1] CRAN (R 4.1.2)
#> stringr 1.5.0 2022-12-02 [1] CRAN (R 4.1.3)
#> styler 1.8.1 2022-11-07 [1] CRAN (R 4.1.3)
#> survival * 3.4-0 2022-08-09 [1] CRAN (R 4.1.3)
#> tibble 3.1.8 2022-07-22 [1] CRAN (R 4.1.3)
#> tidyr 1.3.0 2023-01-24 [1] CRAN (R 4.1.3)
#> tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.1.2)
#> utf8 1.2.3 2023-01-31 [1] CRAN (R 4.1.3)
#> vctrs 0.6.3 2023-06-14 [1] CRAN (R 4.1.2)
#> withr 2.5.0 2022-03-03 [1] CRAN (R 4.1.2)
#> xfun 0.37 2023-01-31 [1] CRAN (R 4.1.3)
#> yaml 2.3.7 2023-01-23 [1] CRAN (R 4.1.3)
#>
#> [1] C:/Program Files/R/R-4.1.2/library
#>
#> ------------------------------------------------------------------------------
from broom.helpers.
Sorry. There was an error in the implementation. Could you check the last version. Now exponentiate is optionnal.
from broom.helpers.
Success! Thank you very much.
from broom.helpers.
Related Issues (20)
- 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
- 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
- Speed improvement when _parameters_ package is used HOT 2
- `tidy_multgee` Incorrectly Defines Values in `y.levels` for Nominal Logistic Regression HOT 1
- Using native pipe for speed improvement? HOT 1
- Check if variable labels are passed for a polynomial continuous terms HOT 1
- Release broom.helpers 1.16.0
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.