You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating the gtsummary package, add_difference of a tbl_summary with dichotomous variables is not working. Next error is obtained:
For variable XXXX (YYYY) and "estimate", "statistic", "p.value", "parameter", "conf.low", and "conf.high" statistics: Expecting variable to be either or <numeric/integer> coded as 0 and 1
The dichotomous variable is a factor, coded as "Yes", "No".
In the tbl_summary, the level of the dichotomous variable is displayed on a single row. What is wrong?
The text was updated successfully, but these errors were encountered:
Thank you for the post @cforne . It was a conscience decision to no longer perform pre-processing on the data before calculating tests (and other statistical computations) and leave it to the user to pass data that was compatible with the tests they are requesting.
But it seems I did not give enough consideration to situations like these. I'll think on it, but it feels like this functionality should be added back to the package. Sorry for the inconvenience.
library(gtsummary)
trial|>dplyr::mutate(response=factor(response, levels= c(0, 1), labels= c("no", "yes"))) |>
tbl_summary(
by=trt,
include=response
) |>
add_difference() |>
as_kable()
#> The following errors were returned during `as_kable()`:#> ✖ For variable `response` (`trt`) and "estimate", "statistic", "p.value",#> "parameter", "conf.low", and "conf.high" statistics: Expecting `variable` to#> be either <logical> or <numeric/integer> coded as 0 and 1.
Characteristic
Drug A N = 98
Drug B N = 102
Difference
95% CI
p-value
response
28 (29%)
33 (34%)
Unknown
3
4
trial|>
tbl_summary(
by=trt,
include=grade,
value=grade~"I"
) |>
add_difference() |>
as_kable()
#> The following errors were returned during `as_kable()`:#> ✖ For variable `grade` (`trt`) and "estimate", "statistic", "p.value",#> "parameter", "conf.low", and "conf.high" statistics: Expecting `variable` to#> be either <logical> or <numeric/integer> coded as 0 and 1.
Dear Daniel:
After updating the gtsummary package, add_difference of a tbl_summary with dichotomous variables is not working. Next error is obtained:
For variable
XXXX
(YYYY
) and "estimate", "statistic", "p.value", "parameter", "conf.low", and "conf.high" statistics: Expectingvariable
to be either or <numeric/integer> coded as 0 and 1The dichotomous variable is a factor, coded as "Yes", "No".
In the tbl_summary, the level of the dichotomous variable is displayed on a single row. What is wrong?
The text was updated successfully, but these errors were encountered: