Validation report

2021-03-14

Introduction

In this document, we compare various DescrTab2 tests with their SAS equivalents. This document is created by including in the .html SAS output. Unfortunately, this has ugly side effects for the formatting of this document, but everything should still be readable.

Wilcoxon one-sample signed-rank test


x <- c(1.83,  0.50,  1.62,  2.48, 1.68, 1.88, 1.55, 3.06, 1.30)
y <- c(0.878, 0.647, 0.598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29)
dat_wilcox.test_1_sample <- tibble(diff = x-y)

descr(dat_wilcox.test_1_sample, test_options = c(nonparametric=TRUE))
Variables
Total
p
(N=9)
diff
N 9 0.039Wil1
mean 0.43
sd 0.43
median 0.49
Q1 - Q3 0.01 – 0.62
min - max -0.15 – 1
Wil1 Wilcoxon one-sample signed-rank test
SAS Output
The SAS System

The CAPABILITY Procedure
Variable: diff

Moments
N 9 Sum Weights 9
Mean 0.43188889 Sum Observations 3.887
Std Deviation 0.42685549 Variance 0.18220561
Skewness -0.0955017 Kurtosis -1.2717312
Uncorrected SS 3.136397 Corrected SS 1.45764489
Coeff Variation 98.8345621 Std Error Mean 0.14228516

Basic Statistical Measures
Location Variability
Mean 0.431889 Std Deviation 0.42686
Median 0.490000 Variance 0.18221
Mode . Range 1.16900
    Interquartile Range 0.61000

Tests for Location: Mu0=0
Test Statistic p Value
Student's t t 3.035375 Pr > |t| 0.0162
Sign M 2.5 Pr >= |M| 0.1797
Signed Rank S 17.5 Pr >= |S| 0.0391

Quantiles (Definition 5)
Level Quantile
100% Max 1.022
99% 1.022
95% 1.022
90% 1.022
75% Q3 0.620
50% Median 0.490
25% Q1 0.010
10% -0.147
5% -0.147
1% -0.147
0% Min -0.147

Extreme Observations
Lowest Highest
Value Obs Value Obs
-0.147 2 0.490 7
-0.080 8 0.590 6
0.010 9 0.620 5
0.430 4 0.952 1
0.490 7 1.022 3

Mann-Whitney U test


x <- c(0.80, 0.83, 1.89, 1.04, 1.45, 1.38, 1.91, 1.64, 0.73, 1.46)
y <- c(1.15, 0.88, 0.90, 0.74, 1.21)
group <- c(rep("Trt", length(x)), rep("Ctrl", length(y)))
dat_wilcox.test_2_sample <- tibble(var=c(x,y), group=group)

descr(dat_wilcox.test_2_sample, "group", test_options = c(nonparametric=TRUE))
Variables
Trt
Ctrl
Total
p
CI
(N=10) (N=5) (N=15)
var
N 10 5 15 0.254MWU HL CI
mean 1.3 0.98 1.2 [-0.15, 0.76]
sd 0.44 0.2 0.4
median 1.4 0.9 1.1
Q1 - Q3 0.83 – 1.6 0.88 – 1.1 0.83 – 1.5
min - max 0.73 – 1.9 0.74 – 1.2 0.73 – 1.9
MWU Mann-Whitney U test
SAS Output
The SAS System

The NPAR1WAY Procedure

Wilcoxon Scores (Rank Sums) for Variable var
Classified by Variable group
group N Sum of
Scores
Expected
Under H0
Std Dev
Under H0
Mean
Score
Trt 10 90.0 80.0 8.164966 9.0
Ctrl 5 30.0 40.0 8.164966 6.0

Wilcoxon Two-Sample Test
Statistic (S) Z Pr < Z Pr > |Z| t Approximation Exact
Pr < Z Pr > |Z| Pr <= S Pr >= |S-Mean|
30.0000 -1.1635 0.1223 0.2446 0.1320 0.2641 0.1272 0.2544
Z includes a continuity correction of 0.5.

Kruskal-Wallis Test
Chi-Square DF Pr > ChiSq
1.5000 1 0.2207

Hodges-Lehmann Estimation
Location Shift (Ctrl - Trt) -0.3050
95% Confidence Limits Interval Midpoint Asymptotic
Standard Error
-0.7600 0.1700 -0.2950 0.2372

Kruskal-Wallis one-way ANOVA


x <- c(2.9, 3.0, 2.5, 2.6, 3.2) # normal subjects
y <- c(3.8, 2.7, 4.0, 2.4)      # with obstructive airway disease
z <- c(2.8, 3.4, 3.7, 2.2, 2.0) # with asbestosis
group <- c(rep("Trt", length(x)), rep("Ctrl", length(y)), rep("Placebo", length(z)))
dat_kruskal.test <- tibble(var=c(x,y,z), group=group)

descr(dat_kruskal.test, "group", test_options = c(nonparametric=TRUE)) 
Variables
Trt
Ctrl
Placebo
Total
p
(N=5) (N=4) (N=5) (N=14)
var
N 5 4 5 14 0.680KW
mean 2.8 3.2 2.8 2.9
sd 0.29 0.79 0.74 0.61
median 2.9 3.2 2.8 2.8
Q1 - Q3 2.6 – 3 2.5 – 3.9 2.2 – 3.4 2.5 – 3.4
min - max 2.5 – 3.2 2.4 – 4 2 – 3.7 2 – 4
KW Kruskal-Wallis one-way ANOVA
SAS Output
The SAS System

The NPAR1WAY Procedure

Kruskal-Wallis Test
Chi-Square DF Pr > ChiSq
0.7714 2 0.6800

Friedman test


RoundingTimes <-
matrix(c(5.40, 5.50, 5.55,
         5.85, 5.70, 5.75,
         5.20, 5.60, 5.50,
         5.55, 5.50, 5.40,
         5.90, 5.85, 5.70,
         5.45, 5.55, 5.60,
         5.40, 5.40, 5.35,
         5.45, 5.50, 5.35,
         5.25, 5.15, 5.00,
         5.85, 5.80, 5.70,
         5.25, 5.20, 5.10,
         5.65, 5.55, 5.45,
         5.60, 5.35, 5.45,
         5.05, 5.00, 4.95,
         5.50, 5.50, 5.40,
         5.45, 5.55, 5.50,
         5.55, 5.55, 5.35,
         5.45, 5.50, 5.55,
         5.50, 5.45, 5.25,
         5.65, 5.60, 5.40,
         5.70, 5.65, 5.55,
         6.30, 6.30, 6.25),
       nrow = 22,
       byrow = TRUE,
       dimnames = list(1 : 22,
                       c("Round Out", "Narrow Angle", "Wide Angle")))

idx <- rep(1:22, 3)
dat <- tibble(var = c(RoundingTimes[,1], RoundingTimes[,2], RoundingTimes[,3]),
              group = c(rep("Round Out", 22), rep("Narrow Angle", 22), rep("Wide Angle", 22)))


descr(dat, "group", test_options = list(nonparametric=TRUE, indices=idx, paired=TRUE))
Variables
Round Out
Narrow Angle
Wide Angle
Total
p
(N=22) (N=22) (N=22) (N=66)
var
N 22 22 22 66 0.004Frie
mean 5.5 5.5 5.5 5.5
sd 0.27 0.26 0.27 0.27
median 5.5 5.5 5.4 5.5
Q1 - Q3 5.4 – 5.6 5.4 – 5.6 5.3 – 5.5 5.4 – 5.6
min - max 5 – 6.3 5 – 6.3 5 – 6.2 5 – 6.3
Frie Friedman test
SAS Output
The SAS System

The FREQ Procedure


Summary Statistics for group by var
Controlling for indices

Cochran-Mantel-Haenszel Statistics (Based on Rank Scores)
Statistic Alternative Hypothesis DF Value Prob
1 Nonzero Correlation 1 5.3571 0.0206
2 Row Mean Scores Differ 2 11.1429 0.0038


Total Sample Size = 66

Cochrans Q test


d.frm <- DescTools::Untable(xtabs(c(6,2,2,6,16,4,4,6) ~ ., 
    expand.grid(rep(list(c("F","U")), times=3))), 
    colnames = LETTERS[1:3])

# rearrange to long shape    
d.long <- reshape(d.frm, varying=1:3, times=names(d.frm)[c(1:3)], 
                  v.names="resp", direction="long")
idx <- d.long$id
dat <- d.long[, 1:2] %>% mutate(time=as.character(time), resp=as.character(resp))

descr(dat, "time", test_options = list(indices=idx, paired=TRUE))
Variables
A
B
C
Total
p
(N=46) (N=46) (N=46) (N=138)
resp
F 28 (61%) 28 (61%) 16 (35%) 72 (52%) 0.014CocQ
U 18 (39%) 18 (39%) 30 (65%) 66 (48%)
CocQ Cochrans Q test

McNemars test

dat <- tibble::tibble(var = c(rep("Approve", 794), rep("Approve", 150), rep("Disapprove", 86), rep("Disapprove", 570),
                      rep("Approve", 794), rep("Disapprove", 150), rep("Approve", 86), rep("Disapprove", 570)),
              group= c(rep("first", 1600), rep("second",1600)))
              
descr(dat, "group", test_options = list(paired=TRUE, indices=c(1:1600, 1:1600)))
Variables
first
second
Total
p
CI
(N=1600) (N=1600) (N=3200)
var
Approve 944 (59%) 880 (55%) 1824 (57%) <0.001McN Prop. dif. CI
Disapprove 656 (41%) 720 (45%) 1376 (43%) [0.0058, 0.076]
McN McNemars test
descr(dat, "group", test_options = list(paired=TRUE, exact=TRUE, indices=c(1:1600, 1:1600)))
Variables
first
second
Total
p
CI
(N=1600) (N=1600) (N=3200)
var
Approve 944 (59%) 880 (55%) 1824 (57%) <0.001eMcN Prop. dif. CI
Disapprove 656 (41%) 720 (45%) 1376 (43%) [0.0058, 0.076]
eMcN Exact McNemars test

dat <-
  tibble::tibble(x = c(
    rep("Approve", 794),
    rep("Approve", 150),
    rep("Disapprove", 86),
    rep("Disapprove", 570)
  ),
  y = c(
    rep("Approve", 794),
    rep("Disapprove", 150),
    rep("Approve", 86),
    rep("Disapprove", 570)
  ))
mcnemar.test(dat$x, dat$y, correct = FALSE)
McNemar's Chi-squared test

data: dat\(x and dat\)y McNemar’s chi-squared = 17.356, df = 1, p-value = 3.099e-05

SAS Output
The SAS System

The FREQ Procedure

Frequency
Percent
Row Pct
Col Pct
Table of x by y
x y
Approve Disapprove Total
Approve
794
49.63
84.11
90.23
150
9.38
15.89
20.83
944
59.00
 
 
Disapprove
86
5.38
13.11
9.77
570
35.63
86.89
79.17
656
41.00
 
 
Total
880
55.00
720
45.00
1600
100.00


Statistics for Table of x by y

McNemar's Test
Chi-Square DF Pr > ChiSq Exact
Pr >= ChiSq
17.3559 1 <.0001 .000037159

Simple Kappa Coefficient
Estimate Standard
Error
95% Confidence Limits
0.6996 0.0180 0.6644 0.7348


Sample Size = 1600

Chi-squared test


dat <- tibble(gender=c(rep("F",sum(c(762, 327, 468)) ), rep("M", sum( c(484, 239, 477)))),
              party=c(rep("Democrat", 762), rep("Independent", 327), rep("Republican", 468),
                      rep("Democrat", 484), rep("Independent", 239), rep("Republican", 477)))
              
descr(dat, "gender")
Variables
F
M
Total
p
CI
(N=1557) (N=1200) (N=2757)
party
Democrat 762 (49%) 484 (40%) 1246 (45%) <0.001chi2
Independent 327 (21%) 239 (20%) 566 (21%)
Republican 468 (30%) 477 (40%) 945 (34%)
chi2 Pearsons chi-squared test
descr(dat)
Variables
Total
p
(N=2757)
gender
F 1557 (56%) <0.001chi1
M 1200 (44%)
party
Democrat 1246 (45%) <0.001chi1
Independent 566 (21%)
Republican 945 (34%)
chi1 Chi-squared goodness-of-fit test

chisq.test(dat$gender, dat$party)
Pearson's Chi-squared test

data: dat\(gender and dat\)party X-squared = 30.07, df = 2, p-value = 2.954e-07

chisq.test(table(dat$gender))
Chi-squared test for given probabilities

data: table(dat$gender) X-squared = 46.227, df = 1, p-value = 1.053e-11

chisq.test(table(dat$party))
Chi-squared test for given probabilities

data: table(dat$party) X-squared = 252.68, df = 2, p-value < 2.2e-16


dat <- tibble(
  
  a = factor(c(0,
               0,
               1,
               1,
               0,
               0,
               0,
               0,
               0,
               0,
               1)),
  b = factor(c(1,
               1,
               1,
               1,
               1,
               1,
               1,
               0,
               0,
               1,
               0))

)

descr(dat, "b")
#> Warning in (function (x, y = NULL, correct = TRUE, p = rep(1/length(x), : Chi-
#> squared approximation may be incorrect
#> Warning in stats::prop.test(table(var, group), correct = FALSE): Chi-squared
#> approximation may be incorrect
Variables
0
1
Total
p
CI
(N=3) (N=8) (N=11)
a
0 2 (67%) 6 (75%) 8 (73%) 0.782chi2 Prop. dif. CI
1 1 (33%) 2 (25%) 3 (27%) [-0.7, 0.53]
chi2 Pearsons chi-squared test
SAS Output
The SAS System

The FREQ Procedure

gender Frequency Percent Cumulative
Frequency
Cumulative
Percent
F 1557 56.47 1557 56.47
M 1200 43.53 2757 100.00

Chi-Square Test
for Equal Proportions
Chi-Square 46.2274
DF 1
Pr > ChiSq <.0001


Sample Size = 2757

party Frequency Percent Cumulative
Frequency
Cumulative
Percent
Democrat 1246 45.19 1246 45.19
Independent 566 20.53 1812 65.72
Republican 945 34.28 2757 100.00

Chi-Square Test
for Equal Proportions
Chi-Square 252.6812
DF 2
Pr > ChiSq <.0001


Sample Size = 2757

Frequency
Percent
Row Pct
Col Pct
Table of gender by party
gender party
Democrat Independent Republican Total
F
762
27.64
48.94
61.16
327
11.86
21.00
57.77
468
16.97
30.06
49.52
1557
56.47
 
 
M
484
17.56
40.33
38.84
239
8.67
19.92
42.23
477
17.30
39.75
50.48
1200
43.53
 
 
Total
1246
45.19
566
20.53
945
34.28
2757
100.00


Statistics for Table of gender by party

Statistic DF Value Prob
Chi-Square 2 30.0701 <.0001
Likelihood Ratio Chi-Square 2 30.0167 <.0001
Mantel-Haenszel Chi-Square 1 28.9797 <.0001
Phi Coefficient   0.1044  
Contingency Coefficient   0.1039  
Cramer's V   0.1044  


Sample Size = 2757



The SAS System

The FREQ Procedure

Frequency
Percent
Row Pct
Col Pct
Table of a by b
a b
0 1 Total
0
2
18.18
25.00
66.67
6
54.55
75.00
75.00
8
72.73
 
 
1
1
9.09
33.33
33.33
2
18.18
66.67
25.00
3
27.27
 
 
Total
3
27.27
8
72.73
11
100.00


Statistics for Table of a by b

Statistic DF Value Prob
Chi-Square 1 0.0764 0.7823
Likelihood Ratio Chi-Square 1 0.0745 0.7849
Continuity Adj. Chi-Square 1 0.0000 1.0000
Mantel-Haenszel Chi-Square 1 0.0694 0.7921
Phi Coefficient   -0.0833  
Contingency Coefficient   0.0830  
Cramer's V   -0.0833  
WARNING: 75% of the cells have expected counts less
than 5. Chi-Square may not be a valid test.

Fisher's Exact Test
Cell (1,1) Frequency (F) 2
Left-sided Pr <= F 0.6606
Right-sided Pr >= F 0.8485
   
Table Probability (P) 0.5091
Two-sided Pr <= P 1.0000


Sample Size = 11

t-test


dat <- sleep[, c("extra", "group")]
              

descr(dat[, "extra"]) 
Variables
Total
p
(N=20)
value
N 20 0.003tt1
mean 1.5
sd 2
median 0.95
Q1 - Q3 -0.05 – 3.4
min - max -1.6 – 5.5
tt1 Students one-sample t-test
descr(dat, "group")
Variables
1
2
Total
p
CI
(N=10) (N=10) (N=20)
extra
N 10 10 20 0.079tt2 Mean dif. CI
mean 0.75 2.3 1.5 [-3.4, 0.21]
sd 1.8 2 2
median 0.35 1.8 0.95
Q1 - Q3 -0.2 – 2 0.8 – 4.4 -0.05 – 3.4
min - max -1.6 – 3.7 -0.1 – 5.5 -1.6 – 5.5
tt2 Welchs two-sample t-test
descr(dat, "group", test_options = list(paired=TRUE, indices=rep(1:10, 2)))
Variables
1
2
Total
p
CI
(N=10) (N=10) (N=20)
extra
N 10 10 20 0.003tpar Mean dif. CI
mean 0.75 2.3 1.5 [-2.5, -0.7]
sd 1.8 2 2
median 0.35 1.8 0.95
Q1 - Q3 -0.2 – 2 0.8 – 4.4 -0.05 – 3.4
min - max -1.6 – 3.7 -0.1 – 5.5 -1.6 – 5.5
tpar Students paired t-test
SAS Output
The SAS System

The UNIVARIATE Procedure
Variable: extra

Moments
N 20 Sum Weights 20
Mean 1.54 Sum Observations 30.8
Std Deviation 2.01791972 Variance 4.072
Skewness 0.45185739 Kurtosis -0.7747436
Uncorrected SS 124.8 Corrected SS 77.368
Coeff Variation 131.033748 Std Error Mean 0.45122057

Basic Statistical Measures
Location Variability
Mean 1.54000 Std Deviation 2.01792
Median 0.95000 Variance 4.07200
Mode -0.10000 Range 7.10000
    Interquartile Range 3.45000

Note: The mode displayed is the smallest of 3 modes with a count of 2.


Tests for Location: Mu0=0
Test Statistic p Value
Student's t t 3.412965 Pr > |t| 0.0029
Sign M 4.5 Pr >= |M| 0.0636
Signed Rank S 67.5 Pr >= |S| 0.0048

Quantiles (Definition 5)
Level Quantile
100% Max 5.50
99% 5.50
95% 5.05
90% 4.50
75% Q3 3.40
50% Median 0.95
25% Q1 -0.05
10% -0.70
5% -1.40
1% -1.60
0% Min -1.60

Extreme Observations
Lowest Highest
Value Obs Value Obs
-1.6 2 3.4 20
-1.2 4 3.7 7
-0.2 3 4.4 16
-0.1 15 4.6 19
-0.1 5 5.5 17



The SAS System

The TTEST Procedure
 
Variable: extra

group Method N Mean Std Dev Std Err Minimum Maximum
1   10 0.7500 1.7890 0.5657 -1.6000 3.7000
2   10 2.3300 2.0022 0.6332 -0.1000 5.5000
Diff (1-2) Pooled   -1.5800 1.8986 0.8491    
Diff (1-2) Satterthwaite   -1.5800   0.8491    

group Method Mean 95% CL Mean Std Dev 95% CL Std Dev
1   0.7500 -0.5298 2.0298 1.7890 1.2305 3.2660
2   2.3300 0.8977 3.7623 2.0022 1.3772 3.6553
Diff (1-2) Pooled -1.5800 -3.3639 0.2039 1.8986 1.4346 2.8077
Diff (1-2) Satterthwaite -1.5800 -3.3655 0.2055      

Method Variances DF t Value Pr > |t|
Pooled Equal 18 -1.86 0.0792
Satterthwaite Unequal 17.776 -1.86 0.0794

Equality of Variances
Method Num DF Den DF F Value Pr > F
Folded F 9 9 1.25 0.7427

F-test


dat <- data.frame(
    y = c(449, 413, 326, 409, 358, 291, 341, 278, 312)/12,
    P = ordered(gl(3, 3)), N = ordered(gl(3, 1, 9))
)
              
descr(dat[, c("y", "P")], "P") 
Variables
1
2
3
Total
p
(N=3) (N=3) (N=3) (N=9)
y
N 3 3 3 9 0.223F
mean 33 29 26 29
sd 5.3 4.9 2.6 4.9
median 34 30 26 28
Q1 - Q3 27 – 37 24 – 34 23 – 28 26 – 34
min - max 27 – 37 24 – 34 23 – 28 23 – 37
F F-test (ANOVA)
descr(dat[, c("y", "N")], "N") 
Variables
1
2
3
Total
p
(N=3) (N=3) (N=3) (N=9)
y
N 3 3 3 9 0.180F
mean 33 29 26 29
sd 4.6 5.7 1.5 4.9
median 34 30 26 28
Q1 - Q3 28 – 37 23 – 34 24 – 27 26 – 34
min - max 28 – 37 23 – 34 24 – 27 23 – 37
F F-test (ANOVA)
SAS Output
The SAS System

The ANOVA Procedure

Class Level Information
Class Levels Values
P 3 1 2 3

Number of Observations Read 9
Number of Observations Used 9



The SAS System

The ANOVA Procedure
 
Dependent Variable: y

Source DF Sum of Squares Mean Square F Value Pr > F
Model 2 76.4490741 38.2245370 1.94 0.2235
Error 6 117.9953704 19.6658951    
Corrected Total 8 194.4444444      

R-Square Coeff Var Root MSE y Mean
0.393167 15.07521 4.434625 29.41667

Source DF Anova SS Mean Square F Value Pr > F
P 2 76.44907407 38.22453704 1.94 0.2235



The SAS System

The ANOVA Procedure

Class Level Information
Class Levels Values
N 3 1 2 3

Number of Observations Read 9
Number of Observations Used 9



The SAS System

The ANOVA Procedure
 
Dependent Variable: y

Source DF Sum of Squares Mean Square F Value Pr > F
Model 2 84.7222222 42.3611111 2.32 0.1797
Error 6 109.7222222 18.2870370    
Corrected Total 8 194.4444444      

R-Square Coeff Var Root MSE y Mean
0.435714 14.53711 4.276335 29.41667

Source DF Anova SS Mean Square F Value Pr > F
N 2 84.72222222 42.36111111 2.32 0.1797

Mixed model ANOVA


dat <- nlme::Orthodont
dat2 <- nlme::Orthodont[1:64,]
dat2$Sex <- "Divers"
dat2$distance <- dat2$distance + c(rep(0.1*c(1,4,3,2), 10), 0.1*rep(c(0.4,2,1.5, 2.3), 6) )
dat2$Subject <- str_replace_all(dat2$Subject, "M", "D")
dat <- bind_rows(dat, dat2)
dat <- as_tibble(dat)


descr(dat[, c("Sex", "distance")], "Sex", test_options = list(paired=TRUE, indices=dat$Subject))
Variables
Male
Female
Divers
Total
p
(N=64) (N=44) (N=64) (N=172)
distance
N 64 44 64 172 0.003MiAn
mean 25 23 25 24
sd 2.9 2.4 2.9 3
median 25 23 25 24
Q1 - Q3 23 – 26 21 – 24 23 – 27 22 – 26
min - max 17 – 32 16 – 28 17 – 32 16 – 32
MiAn Mixed model ANOVA
SAS Output
The SAS System

The Mixed Procedure

Model Information
Data Set WORK.RDATA
Dependent Variable distance
Covariance Structure Variance Components
Subject Effect Subject
Estimation Method REML
Residual Variance Method Profile
Fixed Effects SE Method Model-Based
Degrees of Freedom Method Satterthwaite

Class Level Information
Class Levels Values
Sex 3 Divers Female Male
Subject 43 D01 D02 D03 D04 D05 D06 D07 D08 D09 D10 D11 D12 D13 D14 D15 D16 F01 F02 F03 F04 F05 F06 F07 F08 F09 F10 F11 M01 M02 M03 M04 M05 M06 M07 M08 M09 M10 M11 M12 M13 M14 M15 M16

Dimensions
Covariance Parameters 2
Columns in X 4
Columns in Z per Subject 1
Subjects 43
Max Obs per Subject 4

Number of Observations
Number of Observations Read 172
Number of Observations Used 172
Number of Observations Not Used 0

Iteration History
Iteration Evaluations -2 Res Log Like Criterion
0 1 838.60158118  
1 1 823.17375628 0.00000000

Convergence criteria met.

Covariance Parameter Estimates
Cov Parm Subject Estimate
Intercept Subject 2.2123
Residual   5.6941

Fit Statistics
-2 Res Log Likelihood 823.2
AIC (Smaller is Better) 827.2
AICC (Smaller is Better) 827.2
BIC (Smaller is Better) 830.7

Type 3 Tests of Fixed Effects
Effect Num DF Den DF F Value Pr > F
Sex 2 40 6.69 0.0031

Boschloos test

DescrTab2 uses the exact2x2::boschloo with option tsmethod=central to calculate p-values. There is no comparison for this option readily available.

dat <- tibble(gender=factor(c("M", "M", "M", "M", "M", "M", "F", "F", "F", "F", "F")),
              party=factor(c("A", "A", "B", "B", "B", "B", "A", "A", "A", "B", "B")))
descr(dat, "gender", test_options = c(exact=TRUE))
#> Warning in stats::prop.test(table(var, group), correct = FALSE): Chi-squared
#> approximation may be incorrect
Variables
F
M
Total
p
CI
(N=5) (N=6) (N=11)
party
A 3 (60%) 2 (33%) 5 (45%) 0.491Bolo Prop. dif. CI
B 2 (40%) 4 (67%) 6 (55%) [-0.3, 0.84]
Bolo Boschloos test
exact2x2::boschloo(3, 5, 2, 6, tsmethod="central")
Boschloo's test

data: x1/n1=(3/5) and x2/n2= (2/6) proportion 1 = 0.6, proportion 2 = 0.33333, p-value = 0.4909 alternative hypothesis: true p2(1-p1)/[p1(1-p2)] is less than 1 percent confidence interval: NA NA sample estimates: p2(1-p1)/[p1(1-p2)] 0.3333333

However, we can compare the exact2x2::boschloo with tsmethod=minlike to Exact::exact.test:

exact2x2::boschloo(3, 5, 2, 6, tsmethod="minlike")
#> 
#>  Boschloo's test
#> 
#> data:  x1/n1=(3/5) and x2/n2= (2/6)
#> proportion 1 = 0.6, proportion 2 = 0.33333, p-value = 0.5488
#> alternative hypothesis: true p2(1-p1)/[p1(1-p2)] is not equal to 1
#> 95 percent confidence interval:
#>  NA NA
#> sample estimates:
#> p2(1-p1)/[p1(1-p2)] 
#>           0.3333333
Exact::exact.test(table(dat), method="boschloo", to.plot = FALSE)
#> 
#>  Boschloo's Exact Test
#> 
#> data:  3 out of 5 vs. 2 out of 6
#> test statistic = 0.5671, first sample size = 5, second sample size = 6,
#> p-value = 0.5488
#> alternative hypothesis: true difference in proportion is not equal to 0
#> sample estimates:
#> difference in proportion 
#>                0.2666667