79587075

Date: 2025-04-22 17:06:15
Score: 1
Natty:
Report link

You may also use value argument in tbl_summary like below. First convert the NA in outcome to an explicit level "unknown". Then modify your table to show the counts of "Yes" in your outcome variable.

df |> 
  mutate(outcome = if_else(is.na(outcome), "unknown", outcome)) |> 
  tbl_summary(
    by = group,
    percent = "column",
    value = list(outcome ~ "Yes")
  )

enter image description here

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: nightstand