有没有办法将 gtsummary 中所指类别中的“_”更改为 "Ref" 或任何其他字符串?
Is there a way to change "_" in referent category in the gtsummary to "Ref" or any other string?
我试图将“_”更改为“Ref”,但我无法理解它。也可以将“-”更改为 1 会很好。
期望的输出是 https://www.dropbox.com/scl/fi/9bmrggkdtoegkmbad1bmz/gtsummaryreference.docx?dl=0&rlkey=608mna8aqn0zcjoeh6iest08b
---
title: "Regression Model"
author: "Moses Otieno"
date: "31/03/2021"
output: word_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
```
```{r, include=FALSE}
library(gtsummary)
```
```{r }
m1 <- glm(response ~ age + stage, trial, family = binomial)
tbl_regression(m1, exponentiate = TRUE)
```
具有所需输出的 link 对我不起作用。但这里有一个如何修改 em-dashes 的例子。
library(gtsummary)
#> #Uighur
packageVersion("gtsummary")
#> [1] '1.4.0'
m1 <-
glm(response ~ age + stage, trial, family = binomial) %>%
tbl_regression(
exponentiate = TRUE,
add_estimate_to_reference_rows = TRUE # this adds 1 to the coef row
) %>%
# this will update the em-dash in the CI row to Ref.
modify_table_styling(
columns = ci,
rows = reference_row %in% TRUE,
missing_symbol = "Ref."
)
由 reprex package (v2.0.0)
于 2021-04-23 创建
我试图将“_”更改为“Ref”,但我无法理解它。也可以将“-”更改为 1 会很好。 期望的输出是 https://www.dropbox.com/scl/fi/9bmrggkdtoegkmbad1bmz/gtsummaryreference.docx?dl=0&rlkey=608mna8aqn0zcjoeh6iest08b
---
title: "Regression Model"
author: "Moses Otieno"
date: "31/03/2021"
output: word_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
```
```{r, include=FALSE}
library(gtsummary)
```
```{r }
m1 <- glm(response ~ age + stage, trial, family = binomial)
tbl_regression(m1, exponentiate = TRUE)
```
具有所需输出的 link 对我不起作用。但这里有一个如何修改 em-dashes 的例子。
library(gtsummary)
#> #Uighur
packageVersion("gtsummary")
#> [1] '1.4.0'
m1 <-
glm(response ~ age + stage, trial, family = binomial) %>%
tbl_regression(
exponentiate = TRUE,
add_estimate_to_reference_rows = TRUE # this adds 1 to the coef row
) %>%
# this will update the em-dash in the CI row to Ref.
modify_table_styling(
columns = ci,
rows = reference_row %in% TRUE,
missing_symbol = "Ref."
)