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 01:51:59 +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/t1481763136405ewbc90jpa9r5.htm/, Retrieved Fri, 03 May 2024 10:56:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=299760, Retrieved Fri, 03 May 2024 10:56:40 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact121
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] [chi square] [2016-12-15 00:51:59] [11b61e09f442d73f657668491c17a736] [Current]
Feedback Forum

Post a new message
Dataseries X:
10	10
15	13
13	14
13	NA
11	NA
15	13
12	NA
15	NA
14	NA
12	14
15	14
NA	12
15	12
14	11
11	12
11	14
15	NA
NA	NA
12	NA
11	NA
12	13
8	NA
14	13
14	NA
14	NA
12	NA
14	12
13	12
14	13
14	13
NA	10
14	12
15	13
3	NA
14	10
13	14
12	NA
12	10
14	10
13	14
12	NA
13	14
NA	10
15	13
15	12
5	12
9	NA
11	12
12	10
NA	NA
14	14
15	NA
12	NA
13	8
15	11
12	10
14	NA
12	14
12	12
10	NA
11	14
13	13
13	13
13	13
13	12
12	10
10	14
12	11
10	10
13	13
11	NA
15	NA
9	NA
10	NA
14	NA
10	12
15	13
13	11
10	10
13	14
15	NA
12	7
11	NA
13	13
15	NA
11	15
14	13
14	14
15	NA
13	13
12	11
12	NA
15	14
12	NA
15	14
14	NA
14	12
12	13
15	14
15	13
9	NA
14	NA
15	12
15	10
NA	NA
13	NA
12	NA
12	NA
15	NA
14	12
10	NA
11	NA
10	NA
13	9
11	NA
14	12
13	13
13	NA
15	13
13	11
11	12
11	11
14	NA
15	12
13	NA
13	12
13	13
13	NA
11	NA
14	NA
14	8
13	NA
15	13
12	NA
12	8
12	NA
13	13
7	NA
12	12
14	15
15	14
15	NA
12	11
13	NA
13	10
13	14
14	10
15	15
13	11
14	NA
12	NA
13	12
9	13
11	12
13	9
13	NA
11	14
10	NA
15	NA
14	14
13	12
13	15
15	11
14	NA
15	NA
14	NA
12	12
13	NA
11	11




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299760&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]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=299760&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299760&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 time1 seconds
R ServerBig Analytics Cloud Computing Center







Tabulation of Results
ith x tvdc
789101112131415
3000000000
5000001000
7000000000
8000000000
9000000100
10000301010
11000024031
12110433220
13012135961
14010315431
15000124851

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
ith  x  tvdc \tabularnewline
  & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \tabularnewline
3 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
5 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \tabularnewline
7 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
8 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
9 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \tabularnewline
10 & 0 & 0 & 0 & 3 & 0 & 1 & 0 & 1 & 0 \tabularnewline
11 & 0 & 0 & 0 & 0 & 2 & 4 & 0 & 3 & 1 \tabularnewline
12 & 1 & 1 & 0 & 4 & 3 & 3 & 2 & 2 & 0 \tabularnewline
13 & 0 & 1 & 2 & 1 & 3 & 5 & 9 & 6 & 1 \tabularnewline
14 & 0 & 1 & 0 & 3 & 1 & 5 & 4 & 3 & 1 \tabularnewline
15 & 0 & 0 & 0 & 1 & 2 & 4 & 8 & 5 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299760&T=1

[TABLE]
[ROW][C]Tabulation of Results[/C][/ROW]
[ROW][C]ith  x  tvdc[/C][/ROW]
[ROW][C] [/C][C]7[/C][C]8[/C][C]9[/C][C]10[/C][C]11[/C][C]12[/C][C]13[/C][C]14[/C][C]15[/C][/ROW]
[C]3[/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]5[/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][/ROW]
[C]7[/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]8[/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]9[/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][/ROW]
[C]10[/C][C]0[/C][C]0[/C][C]0[/C][C]3[/C][C]0[/C][C]1[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[C]11[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]2[/C][C]4[/C][C]0[/C][C]3[/C][C]1[/C][/ROW]
[C]12[/C][C]1[/C][C]1[/C][C]0[/C][C]4[/C][C]3[/C][C]3[/C][C]2[/C][C]2[/C][C]0[/C][/ROW]
[C]13[/C][C]0[/C][C]1[/C][C]2[/C][C]1[/C][C]3[/C][C]5[/C][C]9[/C][C]6[/C][C]1[/C][/ROW]
[C]14[/C][C]0[/C][C]1[/C][C]0[/C][C]3[/C][C]1[/C][C]5[/C][C]4[/C][C]3[/C][C]1[/C][/ROW]
[C]15[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]4[/C][C]8[/C][C]5[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299760&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299760&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
ith x tvdc
789101112131415
3000000000
5000001000
7000000000
8000000000
9000000100
10000301010
11000024031
12110433220
13012135961
14010315431
15000124851







Tabulation of Expected Results
ith x tvdc
789101112131415
3000000000
50.010.030.020.120.110.230.240.20.04
7000000000
8000000000
90.010.030.020.120.110.230.240.20.04
100.050.150.10.60.551.151.210.2
110.10.30.21.21.12.32.420.4
120.160.480.321.921.763.683.843.20.64
130.280.840.563.363.086.446.725.61.12
140.180.540.362.161.984.144.323.60.72
150.210.630.422.522.314.835.044.20.84

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
ith  x  tvdc \tabularnewline
  & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \tabularnewline
3 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
5 & 0.01 & 0.03 & 0.02 & 0.12 & 0.11 & 0.23 & 0.24 & 0.2 & 0.04 \tabularnewline
7 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
8 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
9 & 0.01 & 0.03 & 0.02 & 0.12 & 0.11 & 0.23 & 0.24 & 0.2 & 0.04 \tabularnewline
10 & 0.05 & 0.15 & 0.1 & 0.6 & 0.55 & 1.15 & 1.2 & 1 & 0.2 \tabularnewline
11 & 0.1 & 0.3 & 0.2 & 1.2 & 1.1 & 2.3 & 2.4 & 2 & 0.4 \tabularnewline
12 & 0.16 & 0.48 & 0.32 & 1.92 & 1.76 & 3.68 & 3.84 & 3.2 & 0.64 \tabularnewline
13 & 0.28 & 0.84 & 0.56 & 3.36 & 3.08 & 6.44 & 6.72 & 5.6 & 1.12 \tabularnewline
14 & 0.18 & 0.54 & 0.36 & 2.16 & 1.98 & 4.14 & 4.32 & 3.6 & 0.72 \tabularnewline
15 & 0.21 & 0.63 & 0.42 & 2.52 & 2.31 & 4.83 & 5.04 & 4.2 & 0.84 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299760&T=2

[TABLE]
[ROW][C]Tabulation of Expected Results[/C][/ROW]
[ROW][C]ith  x  tvdc[/C][/ROW]
[ROW][C] [/C][C]7[/C][C]8[/C][C]9[/C][C]10[/C][C]11[/C][C]12[/C][C]13[/C][C]14[/C][C]15[/C][/ROW]
[C]3[/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]5[/C][C]0.01[/C][C]0.03[/C][C]0.02[/C][C]0.12[/C][C]0.11[/C][C]0.23[/C][C]0.24[/C][C]0.2[/C][C]0.04[/C][/ROW]
[C]7[/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]8[/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]9[/C][C]0.01[/C][C]0.03[/C][C]0.02[/C][C]0.12[/C][C]0.11[/C][C]0.23[/C][C]0.24[/C][C]0.2[/C][C]0.04[/C][/ROW]
[C]10[/C][C]0.05[/C][C]0.15[/C][C]0.1[/C][C]0.6[/C][C]0.55[/C][C]1.15[/C][C]1.2[/C][C]1[/C][C]0.2[/C][/ROW]
[C]11[/C][C]0.1[/C][C]0.3[/C][C]0.2[/C][C]1.2[/C][C]1.1[/C][C]2.3[/C][C]2.4[/C][C]2[/C][C]0.4[/C][/ROW]
[C]12[/C][C]0.16[/C][C]0.48[/C][C]0.32[/C][C]1.92[/C][C]1.76[/C][C]3.68[/C][C]3.84[/C][C]3.2[/C][C]0.64[/C][/ROW]
[C]13[/C][C]0.28[/C][C]0.84[/C][C]0.56[/C][C]3.36[/C][C]3.08[/C][C]6.44[/C][C]6.72[/C][C]5.6[/C][C]1.12[/C][/ROW]
[C]14[/C][C]0.18[/C][C]0.54[/C][C]0.36[/C][C]2.16[/C][C]1.98[/C][C]4.14[/C][C]4.32[/C][C]3.6[/C][C]0.72[/C][/ROW]
[C]15[/C][C]0.21[/C][C]0.63[/C][C]0.42[/C][C]2.52[/C][C]2.31[/C][C]4.83[/C][C]5.04[/C][C]4.2[/C][C]0.84[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299760&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299760&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
ith x tvdc
789101112131415
3000000000
50.010.030.020.120.110.230.240.20.04
7000000000
8000000000
90.010.030.020.120.110.230.240.20.04
100.050.150.10.60.551.151.210.2
110.10.30.21.21.12.32.420.4
120.160.480.321.921.763.683.843.20.64
130.280.840.563.363.086.446.725.61.12
140.180.540.362.161.984.144.323.60.72
150.210.630.422.522.314.835.044.20.84







Statistical Results
Pearson's Chi-squared test
Exact Pearson Chi Square StatisticNaN
P valueNaN

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

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299760&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
Exact Pearson Chi Square StatisticNaN
P valueNaN



Parameters (Session):
par1 = 1 ; par2 = 2 ; par3 = Exact Pearson Chi-Squared by Simulation ;
Parameters (R input):
par1 = 1 ; par2 = 2 ; par3 = Exact Pearson Chi-Squared by Simulation ;
R code (references can be found in the software module):
par3 <- 'Pearson Chi-Squared'
par2 <- '2'
par1 <- '1'
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')