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
Below is a reproducible example of the bug in pairwise_test_bin() when method = 'mcnemar' wihle changing order of groups with factors only changes order in some column. In the second output below ResponseStats column order does not match Comparison order once the factor order changes. For example in row 3, 5 and 6 group 1 is listed second in Comparison column but the ResponseStats column lists it first.
library(VISCfunctions)
set.seed(1)
x_example <- c(sample(0:1,20,replace = TRUE, prob = c(.90,.10)), #P_1(0 = 90%)
sample(0:1,25,replace = TRUE, prob = c(.10,.90)), #P_2(0 = 10%)
sample(0:1,25,replace = TRUE, prob = c(.5,.5)), #P_3(0 = 50%)
sample(0:1,25,replace = TRUE, prob = c(.10,.90))) #P_4(0 = 10%)
group_example <- c(rep(1,20),
rep(2,25)
,rep(3,25),
rep(4,25))
id_example <- c(1:20, rep(1:25, 3))
# mcnemar with factors in order
pairwise_test_bin(x_example,
factor(group_example, levels = c("1", "2", "3", "4")),
alternative = "two.sided",
method = "mcnemar",
paired = TRUE,
id = id_example,
num_needed_for_test = 2)
# mcnemar with order of factors changed
# ResponseStats column order does not match Comparison order once the factor order changes.
# For example in row 3, 5 and 6 group 1 is listed second in Comparison column but the
# ResponseStats column lists it first
pairwise_test_bin(x_example,
factor(group_example, levels = c("2", "3", "4", "1")),
alternative = "two.sided",
method = "mcnemar",
paired = TRUE,
id = id_example,
num_needed_for_test = 2)
The text was updated successfully, but these errors were encountered:
Below is a reproducible example of the bug in
pairwise_test_bin()
whenmethod = 'mcnemar'
wihle changing order of groups with factors only changes order in some column. In the second output belowResponseStats
column order does not matchComparison
order once the factor order changes. For example in row 3, 5 and 6 group 1 is listed second inComparison
column but theResponseStats
column lists it first.The text was updated successfully, but these errors were encountered: