gtsummary

Renaming Rows in gtsummary, tbl_regression/tbl_stack

半世苍凉 提交于 2021-02-10 14:33:01
问题 I am using gtsummary and have stacked tables for the outputs of 11 different models on top of one another using the tbl_regression and tbl_stack functions. I am looking to see how the odds ratios of one consistent independent variable change across different dependent variables of interest. When I print out the tbl_stack output, it gives me 11 repeated rows of the independent variable name of interest, instead of the name of the unique dependent variables I am interested in. Does anyone know

Renaming Rows in gtsummary, tbl_regression/tbl_stack

倖福魔咒の 提交于 2021-02-10 14:31:09
问题 I am using gtsummary and have stacked tables for the outputs of 11 different models on top of one another using the tbl_regression and tbl_stack functions. I am looking to see how the odds ratios of one consistent independent variable change across different dependent variables of interest. When I print out the tbl_stack output, it gives me 11 repeated rows of the independent variable name of interest, instead of the name of the unique dependent variables I am interested in. Does anyone know

Calculating percent for missing values using gtsummary in Rstudio

一笑奈何 提交于 2021-02-10 08:05:53
问题 My question is a bit similar to this one here. I have this following codes: library(gtsummary) basicvars <- names(isoq) %in% c("homeless_nonself", "test_result") basictable <- isoq[basicvars] # summarize the data table1 <- tbl_summary(basictable, missing = "always", missing_text = "(Missing)", percent = "cell", type = all_dichotomous() ~"categorical" ) %>% bold_labels() ############Selecting the order of variables basiccompletetable <- basictable %>% select(test_result,homeless_nonself)

How to use {gtsummary} package in r shiny app

纵然是瞬间 提交于 2021-02-10 02:29:51
问题 Is it possible to render a table with {gtsummary} in a shiny app? library(gtsummary) # make dataset with a few variables to summarize iris2 <- iris %>% select(Sepal.Length, Sepal.Width, Species) # summarize the data with our package table1 <- tbl_summary(iris2) table1 in a Shiny app: -> shinyApp( ui = fluidPage( fluidRow( column(12, tableOutput('table') ) ) ), server = function(input, output) { output$table <- renderTable(table1) }) Thank you. 回答1: Maybe this what you are looking for. To

Merging tbl_svysummary and stacked tbl_regression tables with different variable names but same labels

五迷三道 提交于 2021-01-28 07:55:09
问题 Follow up question to (Renaming Rows in gtsummary, tbl_regression/tbl_stack): I am now trying to merge the renamed, stacked table (Table 1) with a tbl_summary table that includes the prevalence for each of the outcomes (Table 2). However, because each renamed line of Table 1 is, in reality, just the same variable repeated over and over again, it doesn't merge with Table 2, instead creating a (Table 3) that has duplicated outcome names stacked onto one another. Any way to merge these tables so

Calculate percent from total observations in r gtsummary::tbl_summary?

给你一囗甜甜゛ 提交于 2021-01-27 19:10:18
问题 Issue: In gtsummary the tbl_summary function calculates column percent out of the total non-missing observations. I would like gtsummary to calculate percent from the total of missing and non-missing observations. Example from the gtsummary Table Gallery at http://www.danieldsjoberg.com/gtsummary/articles/gallery.html trial[c("trt", "age", "grade")] %>% tbl_summary( by = trt, missing = "no", statistic = all_continuous() ~ "{median} ({p25}, {p75}) [N = {N_nonmiss}]" ) %>% modify_header(stat_by

regression models in r output table to word

吃可爱长大的小学妹 提交于 2021-01-27 06:33:49
问题 I have been using sjplot to create a combined table. This creates a HTML table. I would like to make a table that can be exported to word. I have reviewed this post which discusses copy and pasting into word, but this alters the formatting of the columns and lines. Output several regression tables into multiple pages of a Word document in R n1 <- glm(N ~ Age_2 , data = n_data, family = "binomial") g1 <- glm(G ~ Age_2 , data = g1_data, family = "binomial") ga1 <- glm(G_1 ~ Age_2 , data = ga1

regression models in r output table to word

寵の児 提交于 2021-01-27 06:33:01
问题 I have been using sjplot to create a combined table. This creates a HTML table. I would like to make a table that can be exported to word. I have reviewed this post which discusses copy and pasting into word, but this alters the formatting of the columns and lines. Output several regression tables into multiple pages of a Word document in R n1 <- glm(N ~ Age_2 , data = n_data, family = "binomial") g1 <- glm(G ~ Age_2 , data = g1_data, family = "binomial") ga1 <- glm(G_1 ~ Age_2 , data = ga1

regression models in r output table to word

吃可爱长大的小学妹 提交于 2021-01-27 06:32:29
问题 I have been using sjplot to create a combined table. This creates a HTML table. I would like to make a table that can be exported to word. I have reviewed this post which discusses copy and pasting into word, but this alters the formatting of the columns and lines. Output several regression tables into multiple pages of a Word document in R n1 <- glm(N ~ Age_2 , data = n_data, family = "binomial") g1 <- glm(G ~ Age_2 , data = g1_data, family = "binomial") ga1 <- glm(G_1 ~ Age_2 , data = ga1

How to generate effect size [90%CI] in the summary table using R package “gtsummary”?

前提是你 提交于 2021-01-24 09:35:53
问题 I am working on creating summary table using the R package "gtsummary". This is actually very good. The add_stat function gives you a lot of freedom to include add-ons. For example, in my area we want to inform the effect size with confidence interval (ES [90% CI]). So, I would like help to include the CI range. The code I implemented is working, but without digit control and without the CI range. # Packages ---------------------------------------------------------------- library(gtsummary)