library("corrkit")
d <- simulate_cor_data(150)
cor_binary_effects(d, c("BIN_CRP", "BIN_IL6"), c("depression", "fatigue"))# A tibble: 4 × 24
X Y level0 level1 n0 n1 prop1 mean0 sd0 mean1 sd1 median0
<chr> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 BIN_CRP depre… low high 74 69 0.483 11.5 3.30 12.8 3.22 11.7
2 BIN_CRP fatig… low high 73 69 0.486 8.02 3.51 8.61 3.69 8.7
3 BIN_IL6 depre… low high 115 27 0.190 11.8 3.31 13.8 2.80 12
4 BIN_IL6 fatig… low high 115 28 0.196 7.61 3.42 10.3 3.07 8
# ℹ 12 more variables: median1 <dbl>, diff <dbl>, diff_low <dbl>,
# diff_high <dbl>, p_t <dbl>, r_rb <dbl>, r_rb_low <dbl>, r_rb_high <dbl>,
# p_mw <dbl>, r_s <dbl>, r_s_bound <dbl>, r_pb <dbl>
res <- cor_compute(d, c("BIN_CRP", "BIN_IL6"), c("depression", "fatigue"))
cor_binary_effects(res)# A tibble: 4 × 24
X Y level0 level1 n0 n1 prop1 mean0 sd0 mean1 sd1 median0
<chr> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 BIN_CRP depre… low high 74 69 0.483 11.5 3.30 12.8 3.22 11.7
2 BIN_CRP fatig… low high 73 69 0.486 8.02 3.51 8.61 3.69 8.7
3 BIN_IL6 depre… low high 115 27 0.190 11.8 3.31 13.8 2.80 12
4 BIN_IL6 fatig… low high 115 28 0.196 7.61 3.42 10.3 3.07 8
# ℹ 12 more variables: median1 <dbl>, diff <dbl>, diff_low <dbl>,
# diff_high <dbl>, p_t <dbl>, r_rb <dbl>, r_rb_low <dbl>, r_rb_high <dbl>,
# p_mw <dbl>, r_s <dbl>, r_s_bound <dbl>, r_pb <dbl>