Summary table for comparative analysis between two numeric variables
stat_two_num.Rd
Create a summary table with t.test: statistic, p-value and IC(95%).
Examples
n <- 20
set.seed(123);df <-
data.frame(
grp_var = sample(paste("group", letters[1:2]),size = n,replace = TRUE),
num_var1 = rnorm(n),
num_var2 = abs(rnorm(n))
)
stat_two_num(df,grp_var,c(num_var1,num_var2))
#> Joining with `by = join_by(name)`
#> Joining with `by = join_by(name)`
Variables
group a n = 11
group b n = 9
Statistic
P-value
CI (95%)
1 Mean (SD) - Student's t-test
2 Median (IQR) - Wilcoxon test