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 computationWed, 17 Dec 2014 18:39:39 +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/17/t14188415870irahy9mk9cwwt1.htm/, Retrieved Thu, 16 May 2024 08:48:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=270568, Retrieved Thu, 16 May 2024 08:48:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact53
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-17 18:39:39] [6baf0af87d9d8aa2cb91b54f39a0a5b0] [Current]
Feedback Forum

Post a new message
Dataseries X:
21 26 50 0 21 13 12 13 13 "'S'"
22 57 62 1 22 8 8 13 16 "'S'"
22 37 54 0 21 14 11 11 11 "'S'"
18 67 71 1 21 16 13 14 10 "'S'"
23 43 54 1 21 14 11 15 9 "'S'"
12 52 65 1 21 13 10 14 8 "'S'"
20 52 73 0 21 15 7 11 26 "'S'"
22 43 52 1 23 13 10 13 10 "'S'"
21 84 84 1 22 20 15 16 10 "'S'"
19 67 42 1 25 17 12 14 8 "'S'"
22 49 66 1 21 15 12 14 13 "'S'"
15 70 65 1 23 16 10 15 11 "'S'"
20 52 78 1 22 12 10 15 8 "'S'"
19 58 73 0 21 17 14 13 12 "'S'"
18 68 75 0 21 11 6 14 24 "'S'"
15 62 72 0 25 16 12 11 21 "'B'"
20 43 66 1 21 16 14 12 5 "'S'"
21 56 70 0 21 15 11 14 14 "'S'"
21 56 61 1 20 13 8 13 11 "'B'"
15 74 81 0 24 14 12 12 9 "'S'"
16 65 71 1 23 19 15 15 8 "'S'"
23 63 69 1 21 16 13 15 17 "'S'"
21 58 71 0 24 17 11 14 18 "'S'"
18 57 72 1 23 10 12 14 16 "'S'"
25 63 68 1 21 15 7 12 23 "'S'"
9 53 70 1 22 14 11 12 9 "'S'"
30 57 68 1 20 14 7 12 14 "'B'"
20 51 61 0 18 16 12 15 13 "'B'"
23 64 67 1 21 15 12 14 10 "'S'"
16 53 76 0 22 17 13 16 8 "'S'"
16 29 70 0 22 14 9 12 10 "'S'"
19 54 60 0 21 16 11 12 19 "'S'"
25 58 72 1 21 15 12 14 11 "'S'"
18 43 69 1 25 16 15 16 16 "'S'"
23 51 71 1 22 16 12 15 12 "'S'"
21 53 62 1 22 10 6 12 11 "'S'"
10 54 70 0 20 8 5 14 11 "'S'"
14 56 64 1 21 17 13 13 10 "'B'"
22 61 58 1 21 14 11 14 13 "'S'"
26 47 76 0 21 10 6 16 14 "'S'"
23 39 52 1 22 14 12 12 8 "'S'"
23 48 59 1 21 12 10 14 11 "'S'"
24 50 68 1 24 16 6 15 11 "'S'"
24 35 76 1 22 16 12 13 13 "'S'"
18 30 65 1 22 16 11 16 15 "'B'"
23 68 67 0 21 8 6 16 15 "'S'"
15 49 59 1 22 16 12 12 16 "'S'"
19 61 69 1 19 15 12 12 12 "'B'"
16 67 76 0 22 8 8 16 12 "'S'"
25 47 63 1 23 13 10 12 17 "'B'"
23 56 75 1 20 14 11 15 14 "'B'"
17 50 63 1 20 13 7 12 15 "'B'"
19 43 60 1 23 16 12 13 12 "'S'"
21 67 73 1 20 19 13 12 13 "'B'"
18 62 63 1 23 19 14 14 7 "'S'"
27 57 70 1 21 14 12 14 8 "'S'"
21 41 75 0 22 15 6 11 16 "'B'"
13 54 66 1 21 13 14 10 20 "'S'"
8 45 63 0 21 10 10 12 14 "'B'"
29 48 63 1 19 16 12 11 10 "'B'"
28 61 64 1 22 15 11 16 16 "'S'"
23 56 70 0 21 11 10 14 11 "'S'"
21 41 75 0 21 9 7 14 26 "'S'"
19 43 61 1 21 16 12 15 9 "'S'"
19 53 60 0 21 12 7 15 15 "'S'"
20 44 62 1 21 12 12 14 12 "'B'"
18 66 73 0 21 14 12 13 21 "'S'"
19 58 61 1 22 14 10 11 20 "'S'"
17 46 66 1 22 13 10 16 20 "'S'"
19 37 64 0 18 15 12 12 10 "'B'"
25 51 59 0 21 17 12 15 15 "'S'"
19 51 64 0 23 14 12 14 10 "'S'"
22 56 60 0 19 11 8 15 16 "'B'"
23 66 56 1 19 9 10 14 9 "'B'"
14 37 78 0 21 7 5 13 17 "'S'"
28 59 53 1 21 13 10 6 10 "'S'"
16 42 67 0 21 15 10 12 19 "'S'"
24 38 59 1 21 12 12 12 13 "'B'"
20 66 66 0 20 15 11 14 8 "'S'"
12 34 68 0 19 14 9 14 11 "'B'"
24 53 71 1 21 16 12 15 9 "'S'"
22 49 66 0 19 14 11 11 12 "'B'"
12 55 73 0 19 13 10 13 10 "'B'"
22 49 72 0 19 16 12 14 9 "'B'"
20 59 71 1 20 13 10 16 14 "'B'"
10 40 59 0 19 16 9 13 14 "'B'"
23 58 64 1 19 16 11 14 10 "'B'"
17 60 66 1 19 16 12 16 8 "'B'"
22 63 78 0 20 10 7 11 13 "'B'"
24 56 68 0 19 12 11 13 9 "'B'"
18 54 73 0 18 12 12 13 14 "'B'"
21 52 62 1 19 12 6 15 8 "'B'"
20 34 65 1 21 12 9 12 16 "'B'"
20 69 68 1 18 19 15 13 14 "'B'"
22 32 65 0 18 14 10 12 14 "'B'"
19 48 60 1 19 13 11 14 8 "'B'"
20 67 71 0 21 16 12 14 11 "'B'"
26 58 65 1 20 15 12 16 11 "'B'"
23 57 68 1 24 12 12 15 13 "'B'"
24 42 64 1 22 8 11 14 12 "'B'"
21 64 74 1 21 10 9 13 13 "'B'"
21 58 69 1 21 16 11 14 9 "'B'"
19 66 76 0 19 16 12 15 10 "'B'"
8 26 68 1 19 10 12 14 12 "'B'"
17 61 72 1 20 18 14 12 11 "'B'"
20 52 67 1 18 12 8 7 13 "'B'"
11 51 63 0 19 16 10 12 17 "'B'"
8 55 59 0 19 10 9 15 15 "'B'"
15 50 73 0 20 14 10 12 15 "'B'"
18 60 66 0 21 12 9 13 14 "'B'"
18 56 62 0 18 11 10 11 10 "'B'"
19 63 69 0 19 15 12 14 15 "'B'"
19 61 66 1 19 7 11 13 14 "'B'"




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gertrude Mary Cox' @ cox.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 & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=270568&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]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=270568&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270568&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'Gertrude Mary Cox' @ cox.wessa.net







Tabulation of Results
gender x opleiding
'B''S'
02324
12937

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
gender  x  opleiding \tabularnewline
  & 'B' & 'S' \tabularnewline
0 & 23 & 24 \tabularnewline
1 & 29 & 37 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=270568&T=1

[TABLE]
[ROW][C]Tabulation of Results[/C][/ROW]
[ROW][C]gender  x  opleiding[/C][/ROW]
[ROW][C] [/C][C]'B'[/C][C]'S'[/C][/ROW]
[C]0[/C][C]23[/C][C]24[/C][/ROW]
[C]1[/C][C]29[/C][C]37[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=270568&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270568&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
gender x opleiding
'B''S'
02324
12937







Tabulation of Expected Results
gender x opleiding
'B''S'
021.6325.37
130.3735.63

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
gender  x  opleiding \tabularnewline
  & 'B' & 'S' \tabularnewline
0 & 21.63 & 25.37 \tabularnewline
1 & 30.37 & 35.63 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=270568&T=2

[TABLE]
[ROW][C]Tabulation of Expected Results[/C][/ROW]
[ROW][C]gender  x  opleiding[/C][/ROW]
[ROW][C] [/C][C]'B'[/C][C]'S'[/C][/ROW]
[C]0[/C][C]21.63[/C][C]25.37[/C][/ROW]
[C]1[/C][C]30.37[/C][C]35.63[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=270568&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270568&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
gender x opleiding
'B''S'
021.6325.37
130.3735.63







Statistical Results
Pearson's Chi-squared test with Yates' continuity correction
Pearson Chi Square Statistic0.11
Degrees of Freedom1
P value0.74

\begin{tabular}{lllllllll}
\hline
Statistical Results \tabularnewline
Pearson's Chi-squared test with Yates' continuity correction \tabularnewline
Pearson Chi Square Statistic & 0.11 \tabularnewline
Degrees of Freedom & 1 \tabularnewline
P value & 0.74 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=270568&T=3

[TABLE]
[ROW][C]Statistical Results[/C][/ROW]
[ROW][C]Pearson's Chi-squared test with Yates' continuity correction[/C][/ROW]
[ROW][C]Pearson Chi Square Statistic[/C][C]0.11[/C][/ROW]
[ROW][C]Degrees of Freedom[/C][C]1[/C][/ROW]
[ROW][C]P value[/C][C]0.74[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=270568&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270568&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 with Yates' continuity correction
Pearson Chi Square Statistic0.11
Degrees of Freedom1
P value0.74



Parameters (Session):
par1 = 5 ; par2 = 4 ; par3 = Pearson Chi-Squared ;
Parameters (R input):
par1 = 4 ; par2 = 10 ; 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')