BayesFactorTest: Fancy Table for two group comparison

Description Usage Arguments Details Value Examples

Description

Fancy Table for two group comparison

Usage

1

Arguments

x

two level variable

y

variable to compare

data

data.frame or tibble used to create model fits. Used for capturing variable labels, if they exist

Details

Two group comparison

Value

A tibble with: Variable, Parameter, Median CI, pd (probability of direction), ROPE CI (R.O.P.E and CI), ROPE% (R.O.P.E precentage), BF (bayes factor), Prior \[loc scale\] (Prior distribution with location and scale parameters)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Real World Examples
data(Bladder_Cancer)
library(bayestestR)
library(tidyverse)
Bladder_Cancer <- Bladder_Cancer %>% 
mutate(Cycles_cat = droplevels(Cycles_cat),
      Clinical_Stage_Model = recode_factor(Clinical_Stage_Grouped, 
                                           'Stage I/II (<=T2NxMx)' = 'Stage I/II (<=T2NxMx)',
                                           'Stage III (T3NxMx)' = 'Stage III/IV (T3/4NxMx)'
                                           ,'Stage IV (T4NxMx)' = 'Stage III/IV (T3/4NxMx)')
)

# For multiple variables use map_dfr function
vars_to_run <- c('PT0N0','Gender', 'Clinical_Stage_Model', 'Cycles_cat')

testmap <- purrr::map_dfr(
 vars_to_run, BayesFactorTest, y='Elix_Sum', data = Bladder_Cancer )

# kable(testmap, 'latex', booktabs = TRUE, linesep = '', 
# caption = 'Bayesian t-tests for Elix Sum')%>%
#  kable_styling(font_size = 7.0) 

# just one 
testone <- BayesFactorTest(x = 'Cycles_cat', y = 'Elix_Sum', data = Bladder_Cancer )

# kable(testone, 'latex', booktabs = TRUE, linesep = '', 
# caption = 'Bayesian t-tests for Elix Sum')%>%
# kable_styling(font_size = 7.0) 

z2thet/MoffittFunctions documentation built on July 17, 2021, 9:51 a.m.