Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_chi_squared_tests.wasp
Title produced by softwareChi-Squared Test, McNemar Test, and Fisher Exact Test
Date of computationThu, 15 Dec 2016 20:00:31 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/15/t1481828448t154xi8daozd61f.htm/, Retrieved Fri, 03 May 2024 08:07:11 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=299962, Retrieved Fri, 03 May 2024 08:07:11 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact51
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Chi-Squared Test, McNemar Test, and Fisher Exact Test] [] [2016-12-15 19:00:31] [462f83e9ca944f1b841aaa868aea0854] [Current]
Feedback Forum

Post a new message
Dataseries X:
15	13
13	16
14	17
13	NA
12	NA
17	16
12	NA
13	NA
13	NA
16	17
12	17
12	15
13	16
16	14
15	16
12	17
NA	NA
NA	NA
15	NA
12	NA
15	16
11	NA
13	16
13	NA
14	NA
14	NA
14	16
15	15
16	16
16	16
16	13
13	15
13	17
14	NA
13	13
14	17
12	NA
17	14
14	14
15	18
13	NA
14	17
15	13
19	16
14	15
13	15
12	NA
NA	15
14	13
15	NA
15	17
12	NA
14	NA
11	11
12	14
10	13
NA	NA
14	17
14	16
15	NA
15	17
13	16
15	16
16	16
12	15
17	12
15	17
NA	14
12	14
16	16
15	NA
15	NA
12	NA
13	NA
10	NA
14	15
11	16
12	14
14	15
12	17
14	NA
12	10
13	NA
13	17
14	NA
12	20
15	17
13	18
13	NA
11	17
12	14
16	NA
11	17
13	NA
12	17
17	NA
14	16
15	18
8	18
13	16
13	NA
15	NA
14	15
13	13
14	NA
12	NA
19	NA
15	NA
14	NA
14	16
15	NA
13	NA
15	NA
14	12
11	NA
17	16
13	16
9	NA
12	16
13	14
17	15
14	14
13	NA
16	15
14	NA
14	15
14	16
10	NA
12	NA
13	NA
14	11
18	NA
14	18
14	NA
13	11
13	NA
16	18
NA	NA
13	15
14	19
8	17
13	NA
13	14
16	NA
14	13
13	17
14	14
12	19
16	14
18	NA
16	NA
15	16
18	16
15	15
14	12
14	NA
15	17
9	NA
17	NA
11	18
15	15
NA	18
15	15
13	NA
NA	NA
15	NA
15	16
14	NA
13	16




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299962&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=299962&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299962&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center







Tabulation of Results
EPSUM x TVDCSUM
1011121314151617181920
800000001100
900000000000
1000010000000
1101000012100
1210004214011
1301022373100
1401223554110
1500020455200
1600012141100
1700101120000
1800000010000
1900000010000

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
EPSUM  x  TVDCSUM \tabularnewline
  & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 \tabularnewline
8 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 \tabularnewline
9 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
10 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
11 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 2 & 1 & 0 & 0 \tabularnewline
12 & 1 & 0 & 0 & 0 & 4 & 2 & 1 & 4 & 0 & 1 & 1 \tabularnewline
13 & 0 & 1 & 0 & 2 & 2 & 3 & 7 & 3 & 1 & 0 & 0 \tabularnewline
14 & 0 & 1 & 2 & 2 & 3 & 5 & 5 & 4 & 1 & 1 & 0 \tabularnewline
15 & 0 & 0 & 0 & 2 & 0 & 4 & 5 & 5 & 2 & 0 & 0 \tabularnewline
16 & 0 & 0 & 0 & 1 & 2 & 1 & 4 & 1 & 1 & 0 & 0 \tabularnewline
17 & 0 & 0 & 1 & 0 & 1 & 1 & 2 & 0 & 0 & 0 & 0 \tabularnewline
18 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \tabularnewline
19 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299962&T=1

[TABLE]
[ROW][C]Tabulation of Results[/C][/ROW]
[ROW][C]EPSUM  x  TVDCSUM[/C][/ROW]
[ROW][C] [/C][C]10[/C][C]11[/C][C]12[/C][C]13[/C][C]14[/C][C]15[/C][C]16[/C][C]17[/C][C]18[/C][C]19[/C][C]20[/C][/ROW]
[C]8[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][C]0[/C][C]0[/C][/ROW]
[C]9[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]10[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]11[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]1[/C][C]0[/C][C]0[/C][/ROW]
[C]12[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]4[/C][C]2[/C][C]1[/C][C]4[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[C]13[/C][C]0[/C][C]1[/C][C]0[/C][C]2[/C][C]2[/C][C]3[/C][C]7[/C][C]3[/C][C]1[/C][C]0[/C][C]0[/C][/ROW]
[C]14[/C][C]0[/C][C]1[/C][C]2[/C][C]2[/C][C]3[/C][C]5[/C][C]5[/C][C]4[/C][C]1[/C][C]1[/C][C]0[/C][/ROW]
[C]15[/C][C]0[/C][C]0[/C][C]0[/C][C]2[/C][C]0[/C][C]4[/C][C]5[/C][C]5[/C][C]2[/C][C]0[/C][C]0[/C][/ROW]
[C]16[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]1[/C][C]4[/C][C]1[/C][C]1[/C][C]0[/C][C]0[/C][/ROW]
[C]17[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]1[/C][C]1[/C][C]2[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]18[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]19[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299962&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299962&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Tabulation of Results
EPSUM x TVDCSUM
1011121314151617181920
800000001100
900000000000
1000010000000
1101000012100
1210004214011
1301022373100
1401223554110
1500020455200
1600012141100
1700101120000
1800000010000
1900000010000







Tabulation of Expected Results
EPSUM x TVDCSUM
1011121314151617181920
80.020.060.060.160.240.320.540.40.140.040.02
900000000000
100.010.030.030.080.120.160.270.20.070.020.01
110.050.150.150.40.60.81.3510.350.10.05
120.140.420.421.121.682.243.782.80.980.280.14
130.190.570.571.522.283.045.133.81.330.380.19
140.240.720.721.922.883.846.484.81.680.480.24
150.180.540.541.442.162.884.863.61.260.360.18
160.10.30.30.81.21.62.720.70.20.1
170.050.150.150.40.60.81.3510.350.10.05
180.010.030.030.080.120.160.270.20.070.020.01
190.010.030.030.080.120.160.270.20.070.020.01

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
EPSUM  x  TVDCSUM \tabularnewline
  & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 \tabularnewline
8 & 0.02 & 0.06 & 0.06 & 0.16 & 0.24 & 0.32 & 0.54 & 0.4 & 0.14 & 0.04 & 0.02 \tabularnewline
9 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
10 & 0.01 & 0.03 & 0.03 & 0.08 & 0.12 & 0.16 & 0.27 & 0.2 & 0.07 & 0.02 & 0.01 \tabularnewline
11 & 0.05 & 0.15 & 0.15 & 0.4 & 0.6 & 0.8 & 1.35 & 1 & 0.35 & 0.1 & 0.05 \tabularnewline
12 & 0.14 & 0.42 & 0.42 & 1.12 & 1.68 & 2.24 & 3.78 & 2.8 & 0.98 & 0.28 & 0.14 \tabularnewline
13 & 0.19 & 0.57 & 0.57 & 1.52 & 2.28 & 3.04 & 5.13 & 3.8 & 1.33 & 0.38 & 0.19 \tabularnewline
14 & 0.24 & 0.72 & 0.72 & 1.92 & 2.88 & 3.84 & 6.48 & 4.8 & 1.68 & 0.48 & 0.24 \tabularnewline
15 & 0.18 & 0.54 & 0.54 & 1.44 & 2.16 & 2.88 & 4.86 & 3.6 & 1.26 & 0.36 & 0.18 \tabularnewline
16 & 0.1 & 0.3 & 0.3 & 0.8 & 1.2 & 1.6 & 2.7 & 2 & 0.7 & 0.2 & 0.1 \tabularnewline
17 & 0.05 & 0.15 & 0.15 & 0.4 & 0.6 & 0.8 & 1.35 & 1 & 0.35 & 0.1 & 0.05 \tabularnewline
18 & 0.01 & 0.03 & 0.03 & 0.08 & 0.12 & 0.16 & 0.27 & 0.2 & 0.07 & 0.02 & 0.01 \tabularnewline
19 & 0.01 & 0.03 & 0.03 & 0.08 & 0.12 & 0.16 & 0.27 & 0.2 & 0.07 & 0.02 & 0.01 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299962&T=2

[TABLE]
[ROW][C]Tabulation of Expected Results[/C][/ROW]
[ROW][C]EPSUM  x  TVDCSUM[/C][/ROW]
[ROW][C] [/C][C]10[/C][C]11[/C][C]12[/C][C]13[/C][C]14[/C][C]15[/C][C]16[/C][C]17[/C][C]18[/C][C]19[/C][C]20[/C][/ROW]
[C]8[/C][C]0.02[/C][C]0.06[/C][C]0.06[/C][C]0.16[/C][C]0.24[/C][C]0.32[/C][C]0.54[/C][C]0.4[/C][C]0.14[/C][C]0.04[/C][C]0.02[/C][/ROW]
[C]9[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]10[/C][C]0.01[/C][C]0.03[/C][C]0.03[/C][C]0.08[/C][C]0.12[/C][C]0.16[/C][C]0.27[/C][C]0.2[/C][C]0.07[/C][C]0.02[/C][C]0.01[/C][/ROW]
[C]11[/C][C]0.05[/C][C]0.15[/C][C]0.15[/C][C]0.4[/C][C]0.6[/C][C]0.8[/C][C]1.35[/C][C]1[/C][C]0.35[/C][C]0.1[/C][C]0.05[/C][/ROW]
[C]12[/C][C]0.14[/C][C]0.42[/C][C]0.42[/C][C]1.12[/C][C]1.68[/C][C]2.24[/C][C]3.78[/C][C]2.8[/C][C]0.98[/C][C]0.28[/C][C]0.14[/C][/ROW]
[C]13[/C][C]0.19[/C][C]0.57[/C][C]0.57[/C][C]1.52[/C][C]2.28[/C][C]3.04[/C][C]5.13[/C][C]3.8[/C][C]1.33[/C][C]0.38[/C][C]0.19[/C][/ROW]
[C]14[/C][C]0.24[/C][C]0.72[/C][C]0.72[/C][C]1.92[/C][C]2.88[/C][C]3.84[/C][C]6.48[/C][C]4.8[/C][C]1.68[/C][C]0.48[/C][C]0.24[/C][/ROW]
[C]15[/C][C]0.18[/C][C]0.54[/C][C]0.54[/C][C]1.44[/C][C]2.16[/C][C]2.88[/C][C]4.86[/C][C]3.6[/C][C]1.26[/C][C]0.36[/C][C]0.18[/C][/ROW]
[C]16[/C][C]0.1[/C][C]0.3[/C][C]0.3[/C][C]0.8[/C][C]1.2[/C][C]1.6[/C][C]2.7[/C][C]2[/C][C]0.7[/C][C]0.2[/C][C]0.1[/C][/ROW]
[C]17[/C][C]0.05[/C][C]0.15[/C][C]0.15[/C][C]0.4[/C][C]0.6[/C][C]0.8[/C][C]1.35[/C][C]1[/C][C]0.35[/C][C]0.1[/C][C]0.05[/C][/ROW]
[C]18[/C][C]0.01[/C][C]0.03[/C][C]0.03[/C][C]0.08[/C][C]0.12[/C][C]0.16[/C][C]0.27[/C][C]0.2[/C][C]0.07[/C][C]0.02[/C][C]0.01[/C][/ROW]
[C]19[/C][C]0.01[/C][C]0.03[/C][C]0.03[/C][C]0.08[/C][C]0.12[/C][C]0.16[/C][C]0.27[/C][C]0.2[/C][C]0.07[/C][C]0.02[/C][C]0.01[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299962&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299962&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Tabulation of Expected Results
EPSUM x TVDCSUM
1011121314151617181920
80.020.060.060.160.240.320.540.40.140.040.02
900000000000
100.010.030.030.080.120.160.270.20.070.020.01
110.050.150.150.40.60.81.3510.350.10.05
120.140.420.421.121.682.243.782.80.980.280.14
130.190.570.571.522.283.045.133.81.330.380.19
140.240.720.721.922.883.846.484.81.680.480.24
150.180.540.541.442.162.884.863.61.260.360.18
160.10.30.30.81.21.62.720.70.20.1
170.050.150.150.40.60.81.3510.350.10.05
180.010.030.030.080.120.160.270.20.070.020.01
190.010.030.030.080.120.160.270.20.070.020.01







Statistical Results
Pearson's Chi-squared test
Pearson Chi Square StatisticNaN
Degrees of Freedom110
P valueNaN

\begin{tabular}{lllllllll}
\hline
Statistical Results \tabularnewline
Pearson's Chi-squared test \tabularnewline
Pearson Chi Square Statistic & NaN \tabularnewline
Degrees of Freedom & 110 \tabularnewline
P value & NaN \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299962&T=3

[TABLE]
[ROW][C]Statistical Results[/C][/ROW]
[ROW][C]Pearson's Chi-squared test[/C][/ROW]
[ROW][C]Pearson Chi Square Statistic[/C][C]NaN[/C][/ROW]
[ROW][C]Degrees of Freedom[/C][C]110[/C][/ROW]
[ROW][C]P value[/C][C]NaN[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299962&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299962&T=3

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Statistical Results
Pearson's Chi-squared test
Pearson Chi Square StatisticNaN
Degrees of Freedom110
P valueNaN



Parameters (Session):
par1 = 1 ; par2 = 2 ; par3 = 0.95 ; par4 = two.sided ; par5 = unpaired ; par6 = 0.0 ;
Parameters (R input):
par1 = 1 ; par2 = 2 ; par3 = Pearson Chi-Squared ;
R code (references can be found in the software module):
library(vcd)
cat1 <- as.numeric(par1) #
cat2<- as.numeric(par2) #
simulate.p.value=FALSE
if (par3 == 'Exact Pearson Chi-Squared by Simulation') simulate.p.value=TRUE
x <- t(x)
(z <- array(unlist(x),dim=c(length(x[,1]),length(x[1,]))))
(table1 <- table(z[,cat1],z[,cat2]))
(V1<-dimnames(y)[[1]][cat1])
(V2<-dimnames(y)[[1]][cat2])
bitmap(file='pic1.png')
assoc(ftable(z[,cat1],z[,cat2],row.vars=1,dnn=c(V1,V2)),shade=T)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Tabulation of Results',ncol(table1)+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,paste(V1,' x ', V2),ncol(table1)+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, ' ', 1,TRUE)
for(nc in 1:ncol(table1)){
a<-table.element(a, colnames(table1)[nc], 1, TRUE)
}
a<-table.row.end(a)
for(nr in 1:nrow(table1) ){
a<-table.element(a, rownames(table1)[nr], 1, TRUE)
for(nc in 1:ncol(table1) ){
a<-table.element(a, table1[nr, nc], 1, FALSE)
}
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
(cst<-chisq.test(table1, simulate.p.value=simulate.p.value) )
if (par3 == 'McNemar Chi-Squared') {
(cst <- mcnemar.test(table1))
}
if (par3=='Fisher Exact Test') {
(cst <- fisher.test(table1))
}
if ((par3 != 'McNemar Chi-Squared') & (par3 != 'Fisher Exact Test')) {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Tabulation of Expected Results',ncol(table1)+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,paste(V1,' x ', V2),ncol(table1)+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, ' ', 1,TRUE)
for(nc in 1:ncol(table1)){
a<-table.element(a, colnames(table1)[nc], 1, TRUE)
}
a<-table.row.end(a)
for(nr in 1:nrow(table1) ){
a<-table.element(a, rownames(table1)[nr], 1, TRUE)
for(nc in 1:ncol(table1) ){
a<-table.element(a, round(cst$expected[nr, nc], digits=2), 1, FALSE)
}
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')
}
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Statistical Results',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, cst$method, 2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
if (par3=='Pearson Chi-Squared') a<-table.element(a, 'Pearson Chi Square Statistic', 1, TRUE)
if (par3=='Exact Pearson Chi-Squared by Simulation') a<-table.element(a, 'Exact Pearson Chi Square Statistic', 1, TRUE)
if (par3=='McNemar Chi-Squared') a<-table.element(a, 'McNemar Chi Square Statistic', 1, TRUE)
if (par3=='Fisher Exact Test') a<-table.element(a, 'Odds Ratio', 1, TRUE)
if (par3=='Fisher Exact Test') {
if ((ncol(table1) == 2) & (nrow(table1) == 2)) {
a<-table.element(a, round(cst$estimate, digits=2), 1,FALSE)
} else {
a<-table.element(a, '--', 1,FALSE)
}
} else {
a<-table.element(a, round(cst$statistic, digits=2), 1,FALSE)
}
a<-table.row.end(a)
if(!simulate.p.value){
if(par3!='Fisher Exact Test') {
a<-table.row.start(a)
a<-table.element(a, 'Degrees of Freedom', 1, TRUE)
a<-table.element(a, cst$parameter, 1,FALSE)
a<-table.row.end(a)
}
}
a<-table.row.start(a)
a<-table.element(a, 'P value', 1, TRUE)
a<-table.element(a, round(cst$p.value, digits=2), 1,FALSE)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable2.tab')