helper function: sort out a nice report table to summarize binary analysis results
Source:R/reporting.R
report_table_binary.Rd
helper function: sort out a nice report table to summarize binary analysis results
Usage
report_table_binary(
binobj,
weighted_result = NULL,
eff_measure = c("OR", "RD", "RR"),
tag = NULL
)
Value
a data frame with sample size, incidence rate, estimate of binary effect measure with 95% CI and Wald test of hazard ratio
Examples
data(adrs_sat)
testdat <- data.frame(Yes = 280, No = 120)
rownames(testdat) <- "B"
pseudo_ipd_binary_sat <- get_pseudo_ipd_binary(
binary_agd = testdat,
format = "unstacked"
)
combined_data <- rbind(adrs_sat[, c("USUBJID", "RESPONSE", "ARM")], pseudo_ipd_binary_sat)
combined_data$ARM <- as.factor(combined_data$ARM)
binobj_dat <- glm(RESPONSE ~ ARM, combined_data, family = binomial(link = "logit"))
report_table_binary(binobj_dat, eff_measure = "OR")
#> Waiting for profiling to be done...
#> treatment N n.events(%) OR[95% CI] p-Value
#> B B 400 280(70.0) 0.66[0.49;0.89] 0.006
#> A A 500 390(78.0)