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 computationFri, 12 Dec 2014 12:36:20 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2014/Dec/12/t1418387799p79ck1sztgtvlfu.htm/, Retrieved Thu, 31 Oct 2024 23:04:09 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=266608, Retrieved Thu, 31 Oct 2024 23:04:09 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact97
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] [] [2014-12-12 12:36:20] [d33b7eb92cfcc384850e3711242e8bfe] [Current]
Feedback Forum

Post a new message
Dataseries X:
23	1
22	1
21	1
25	1
30	0
17	1
27	1
23	0
23	1
18	0
18	0
23	1
19	1
15	1
20	1
16	1
24	1
25	1
25	1
19	0
19	1
16	1
19	1
19	1
23	1
21	1
22	0
19	1
20	1
20	1
3	1
23	1
23	0
20	0
15	1
16	0
7	0
24	1
17	0
24	1
24	1
19	0
25	1
20	1
28	1
23	0
27	0
18	0
28	0
21	1
19	0
23	1
27	0
22	1
28	0
25	1
21	0
22	0
28	1
20	0
29	1
25	1
25	1
20	1
20	1
16	0
20	1
20	0
23	0
18	0
25	1
18	0
19	1
25	0
25	0
25	0
24	0
19	1
26	1
10	1
17	1
13	0
17	0
30	1
25	0
4	0
16	0
21	0
23	1
22	1
17	0
20	0
20	1
22	0
16	1
23	1
0	0
18	1
25	1
23	1
12	0
18	0
24	0
11	1
18	1
23	1
24	1
29	0
18	0
15	0
29	1
16	1
19	0
22	0
16	0
23	1
23	1
19	0
4	0
20	0
24	1
20	1
4	1
24	1
22	0
16	1
3	1
15	1
24	0
17	0
20	1
27	0
26	1
23	1
17	0
20	1
22	0
19	1
24	1
19	0
23	1
15	0
27	1
26	0
22	1
22	0
18	0
15	1
22	1
27	0
10	1
20	1
17	0
23	1
19	0
13	0
27	1
23	1
16	0
25	1
2	0
26	0
20	1
23	0
22	0




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=266608&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=266608&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=266608&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 Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net







Tabulation of Results
Numeracy x Gender
01
010
210
302
421
710
1002
1101
1210
1320
1524
1655
1762
1882
1978
20513
2123
2285
23516
2438
25410
2622
2743
2822
2912
3011

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
Numeracy  x  Gender \tabularnewline
  & 0 & 1 \tabularnewline
0 & 1 & 0 \tabularnewline
2 & 1 & 0 \tabularnewline
3 & 0 & 2 \tabularnewline
4 & 2 & 1 \tabularnewline
7 & 1 & 0 \tabularnewline
10 & 0 & 2 \tabularnewline
11 & 0 & 1 \tabularnewline
12 & 1 & 0 \tabularnewline
13 & 2 & 0 \tabularnewline
15 & 2 & 4 \tabularnewline
16 & 5 & 5 \tabularnewline
17 & 6 & 2 \tabularnewline
18 & 8 & 2 \tabularnewline
19 & 7 & 8 \tabularnewline
20 & 5 & 13 \tabularnewline
21 & 2 & 3 \tabularnewline
22 & 8 & 5 \tabularnewline
23 & 5 & 16 \tabularnewline
24 & 3 & 8 \tabularnewline
25 & 4 & 10 \tabularnewline
26 & 2 & 2 \tabularnewline
27 & 4 & 3 \tabularnewline
28 & 2 & 2 \tabularnewline
29 & 1 & 2 \tabularnewline
30 & 1 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=266608&T=1

[TABLE]
[ROW][C]Tabulation of Results[/C][/ROW]
[ROW][C]Numeracy  x  Gender[/C][/ROW]
[ROW][C] [/C][C]0[/C][C]1[/C][/ROW]
[C]0[/C][C]1[/C][C]0[/C][/ROW]
[C]2[/C][C]1[/C][C]0[/C][/ROW]
[C]3[/C][C]0[/C][C]2[/C][/ROW]
[C]4[/C][C]2[/C][C]1[/C][/ROW]
[C]7[/C][C]1[/C][C]0[/C][/ROW]
[C]10[/C][C]0[/C][C]2[/C][/ROW]
[C]11[/C][C]0[/C][C]1[/C][/ROW]
[C]12[/C][C]1[/C][C]0[/C][/ROW]
[C]13[/C][C]2[/C][C]0[/C][/ROW]
[C]15[/C][C]2[/C][C]4[/C][/ROW]
[C]16[/C][C]5[/C][C]5[/C][/ROW]
[C]17[/C][C]6[/C][C]2[/C][/ROW]
[C]18[/C][C]8[/C][C]2[/C][/ROW]
[C]19[/C][C]7[/C][C]8[/C][/ROW]
[C]20[/C][C]5[/C][C]13[/C][/ROW]
[C]21[/C][C]2[/C][C]3[/C][/ROW]
[C]22[/C][C]8[/C][C]5[/C][/ROW]
[C]23[/C][C]5[/C][C]16[/C][/ROW]
[C]24[/C][C]3[/C][C]8[/C][/ROW]
[C]25[/C][C]4[/C][C]10[/C][/ROW]
[C]26[/C][C]2[/C][C]2[/C][/ROW]
[C]27[/C][C]4[/C][C]3[/C][/ROW]
[C]28[/C][C]2[/C][C]2[/C][/ROW]
[C]29[/C][C]1[/C][C]2[/C][/ROW]
[C]30[/C][C]1[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=266608&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=266608&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
Numeracy x Gender
01
010
210
302
421
710
1002
1101
1210
1320
1524
1655
1762
1882
1978
20513
2123
2285
23516
2438
25410
2622
2743
2822
2912
3011







Tabulation of Expected Results
Numeracy x Gender
01
00.440.56
20.440.56
30.881.12
41.331.67
70.440.56
100.881.12
110.440.56
120.440.56
130.881.12
152.653.35
164.425.58
173.544.46
184.425.58
196.648.36
207.9610.04
212.212.79
225.757.25
239.2911.71
244.876.13
256.197.81
261.772.23
273.13.9
281.772.23
291.331.67
300.881.12

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
Numeracy  x  Gender \tabularnewline
  & 0 & 1 \tabularnewline
0 & 0.44 & 0.56 \tabularnewline
2 & 0.44 & 0.56 \tabularnewline
3 & 0.88 & 1.12 \tabularnewline
4 & 1.33 & 1.67 \tabularnewline
7 & 0.44 & 0.56 \tabularnewline
10 & 0.88 & 1.12 \tabularnewline
11 & 0.44 & 0.56 \tabularnewline
12 & 0.44 & 0.56 \tabularnewline
13 & 0.88 & 1.12 \tabularnewline
15 & 2.65 & 3.35 \tabularnewline
16 & 4.42 & 5.58 \tabularnewline
17 & 3.54 & 4.46 \tabularnewline
18 & 4.42 & 5.58 \tabularnewline
19 & 6.64 & 8.36 \tabularnewline
20 & 7.96 & 10.04 \tabularnewline
21 & 2.21 & 2.79 \tabularnewline
22 & 5.75 & 7.25 \tabularnewline
23 & 9.29 & 11.71 \tabularnewline
24 & 4.87 & 6.13 \tabularnewline
25 & 6.19 & 7.81 \tabularnewline
26 & 1.77 & 2.23 \tabularnewline
27 & 3.1 & 3.9 \tabularnewline
28 & 1.77 & 2.23 \tabularnewline
29 & 1.33 & 1.67 \tabularnewline
30 & 0.88 & 1.12 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=266608&T=2

[TABLE]
[ROW][C]Tabulation of Expected Results[/C][/ROW]
[ROW][C]Numeracy  x  Gender[/C][/ROW]
[ROW][C] [/C][C]0[/C][C]1[/C][/ROW]
[C]0[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]2[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]3[/C][C]0.88[/C][C]1.12[/C][/ROW]
[C]4[/C][C]1.33[/C][C]1.67[/C][/ROW]
[C]7[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]10[/C][C]0.88[/C][C]1.12[/C][/ROW]
[C]11[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]12[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]13[/C][C]0.88[/C][C]1.12[/C][/ROW]
[C]15[/C][C]2.65[/C][C]3.35[/C][/ROW]
[C]16[/C][C]4.42[/C][C]5.58[/C][/ROW]
[C]17[/C][C]3.54[/C][C]4.46[/C][/ROW]
[C]18[/C][C]4.42[/C][C]5.58[/C][/ROW]
[C]19[/C][C]6.64[/C][C]8.36[/C][/ROW]
[C]20[/C][C]7.96[/C][C]10.04[/C][/ROW]
[C]21[/C][C]2.21[/C][C]2.79[/C][/ROW]
[C]22[/C][C]5.75[/C][C]7.25[/C][/ROW]
[C]23[/C][C]9.29[/C][C]11.71[/C][/ROW]
[C]24[/C][C]4.87[/C][C]6.13[/C][/ROW]
[C]25[/C][C]6.19[/C][C]7.81[/C][/ROW]
[C]26[/C][C]1.77[/C][C]2.23[/C][/ROW]
[C]27[/C][C]3.1[/C][C]3.9[/C][/ROW]
[C]28[/C][C]1.77[/C][C]2.23[/C][/ROW]
[C]29[/C][C]1.33[/C][C]1.67[/C][/ROW]
[C]30[/C][C]0.88[/C][C]1.12[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=266608&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=266608&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
Numeracy x Gender
01
00.440.56
20.440.56
30.881.12
41.331.67
70.440.56
100.881.12
110.440.56
120.440.56
130.881.12
152.653.35
164.425.58
173.544.46
184.425.58
196.648.36
207.9610.04
212.212.79
225.757.25
239.2911.71
244.876.13
256.197.81
261.772.23
273.13.9
281.772.23
291.331.67
300.881.12







Statistical Results
Pearson's Chi-squared test
Pearson Chi Square Statistic31.43
Degrees of Freedom24
P value0.14

\begin{tabular}{lllllllll}
\hline
Statistical Results \tabularnewline
Pearson's Chi-squared test \tabularnewline
Pearson Chi Square Statistic & 31.43 \tabularnewline
Degrees of Freedom & 24 \tabularnewline
P value & 0.14 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=266608&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]31.43[/C][/ROW]
[ROW][C]Degrees of Freedom[/C][C]24[/C][/ROW]
[ROW][C]P value[/C][C]0.14[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=266608&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=266608&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 Statistic31.43
Degrees of Freedom24
P value0.14



Parameters (Session):
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')