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 computationMon, 15 Dec 2014 19:07:15 +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/15/t1418670445scu2jq74lbmkk61.htm/, Retrieved Thu, 16 May 2024 04:44:32 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=268920, Retrieved Thu, 16 May 2024 04:44:32 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact56
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Histogram] [skew1] [2014-12-13 18:52:26] [6aa28f01a40e2da66a40e1bfb2b28c13]
- RMPD    [Chi-Squared Test, McNemar Test, and Fisher Exact Test] [] [2014-12-15 19:07:15] [9a966322e4d935aee68609d815c1a240] [Current]
Feedback Forum

Post a new message
Dataseries X:
1 50
1 68
1 62
1 54
1 71
1 54
1 65
1 73
1 52
1 84
1 42
1 66
1 65
1 73
1 75
0 72
1 66
1 70
1 81
1 69
1 71
1 68
1 70
0 68
1 67
1 76
1 70
1 60
1 72
1 71
1 70
0 64
1 76
1 68
1 76
0 65
1 67
0 75
1 60
0 73
1 63
1 70
1 66
1 64
1 70
1 75
1 60
1 66
1 59
1 78
1 67
0 59
1 66
1 71
0 66
0 72
0 71
0 59
0 78
0 65
0 65
0 71
0 72
0 66
0 69
1 51
1 56
1 67
1 69
0 57
0 56
1 55
1 63
1 67
1 65
1 47
1 76
1 64
1 68
1 64
1 65
0 71
1 63
1 60
1 68
1 72
1 70
1 61
1 61
1 62
1 71
1 71
1 51
0 56
1 70
1 73
1 76
1 59
1 68
1 48
1 52
1 59
1 60
1 59
1 57
1 79
1 60
1 60
1 59
0 62
0 59
1 61
1 71
0 57
0 66
0 63
0 69
1 58
1 59
0 48
0 66
0 73
0 67
0 61
0 68
0 75
0 62
0 69
1 58
1 60
0 74
1 55
1 62
0 63
1 69
0 58
0 58
1 68
0 72
0 62
0 62
0 65
0 69
0 66
0 72
0 62
0 75
0 58
0 66
0 55
0 47
1 72
0 62
0 64
0 64
1 19
0 50
1 68
0 70
1 79
0 69
1 71
0 48
0 66
0 73
0 74
0 66
1 71
1 74
0 78
1 75
1 53
0 60
1 50
1 70
0 69
0 65
1 78
0 78
1 59
1 72
1 70
0 63
1 63
0 71
1 74
1 67
1 66
1 62
0 80
1 73
1 67
1 61
0 73
1 74
1 32
0 69
1 69
0 84
0 64
0 58
1 60
0 59
0 78
1 57
1 60
1 68
1 68
1 73
1 69
0 67
0 60
1 65
0 66
0 74
1 81
0 72
0 55
0 49
0 74
0 53
0 64
0 65
0 57
0 51
0 80
0 67
0 70
0 74
0 75
0 70
0 69
0 65
1 55
0 71
0 65




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=268920&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=268920&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=268920&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
s/b_(s_=_1) x AMS.E
1932424748495051525354555657585960616263646566676869707172737475767879808184
000012111010223442163589328356454040201
111111022212312271044435671051094533522021

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
s/b_(s_=_1)  x  AMS.E \tabularnewline
  & 19 & 32 & 42 & 47 & 48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 & 56 & 57 & 58 & 59 & 60 & 61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 & 73 & 74 & 75 & 76 & 78 & 79 & 80 & 81 & 84 \tabularnewline
0 & 0 & 0 & 0 & 1 & 2 & 1 & 1 & 1 & 0 & 1 & 0 & 2 & 2 & 3 & 4 & 4 & 2 & 1 & 6 & 3 & 5 & 8 & 9 & 3 & 2 & 8 & 3 & 5 & 6 & 4 & 5 & 4 & 0 & 4 & 0 & 2 & 0 & 1 \tabularnewline
1 & 1 & 1 & 1 & 1 & 1 & 0 & 2 & 2 & 2 & 1 & 2 & 3 & 1 & 2 & 2 & 7 & 10 & 4 & 4 & 4 & 3 & 5 & 6 & 7 & 10 & 5 & 10 & 9 & 4 & 5 & 3 & 3 & 5 & 2 & 2 & 0 & 2 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=268920&T=1

[TABLE]
[ROW]Tabulation of Results[/C][/ROW]
[ROW]s/b_(s_=_1)  x  AMS.E[/C][/ROW]
[ROW][C] [/C][C]19[/C][C]32[/C][C]42[/C][C]47[/C][C]48[/C][C]49[/C][C]50[/C][C]51[/C][C]52[/C][C]53[/C][C]54[/C][C]55[/C][C]56[/C][C]57[/C][C]58[/C][C]59[/C][C]60[/C][C]61[/C][C]62[/C][C]63[/C][C]64[/C][C]65[/C][C]66[/C][C]67[/C][C]68[/C][C]69[/C][C]70[/C][C]71[/C][C]72[/C][C]73[/C][C]74[/C][C]75[/C][C]76[/C][C]78[/C][C]79[/C][C]80[/C][C]81[/C][C]84[/C][/ROW]
[C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]1[/C][C]1[/C][C]1[/C][C]0[/C][C]1[/C][C]0[/C][C]2[/C][C]2[/C][C]3[/C][C]4[/C][C]4[/C][C]2[/C][C]1[/C][C]6[/C][C]3[/C][C]5[/C][C]8[/C][C]9[/C][C]3[/C][C]2[/C][C]8[/C][C]3[/C][C]5[/C][C]6[/C][C]4[/C][C]5[/C][C]4[/C][C]0[/C][C]4[/C][C]0[/C][C]2[/C][C]0[/C][C]1[/C][/ROW]
[C]1[/C][C]1[/C][C]1[/C][C]1[/C][C]1[/C][C]1[/C][C]0[/C][C]2[/C][C]2[/C][C]2[/C][C]1[/C][C]2[/C][C]3[/C][C]1[/C][C]2[/C][C]2[/C][C]7[/C][C]10[/C][C]4[/C][C]4[/C][C]4[/C][C]3[/C][C]5[/C][C]6[/C][C]7[/C][C]10[/C][C]5[/C][C]10[/C][C]9[/C][C]4[/C][C]5[/C][C]3[/C][C]3[/C][C]5[/C][C]2[/C][C]2[/C][C]0[/C][C]2[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=268920&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=268920&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
s/b_(s_=_1) x AMS.E
1932424748495051525354555657585960616263646566676869707172737475767879808184
000012111010223442163589328356454040201
111111022212312271044435671051094533522021







Tabulation of Expected Results
s/b_(s_=_1) x AMS.E
1932424748495051525354555657585960616263646566676869707172737475767879808184
00.440.440.440.871.310.441.311.310.870.870.872.181.312.182.624.85.242.184.363.063.495.676.554.365.245.675.676.114.363.933.493.062.182.620.870.870.870.87
10.560.560.561.131.690.561.691.691.131.131.132.821.692.823.386.26.762.825.643.944.517.338.455.646.767.337.337.895.645.074.513.942.823.381.131.131.131.13

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
s/b_(s_=_1)  x  AMS.E \tabularnewline
  & 19 & 32 & 42 & 47 & 48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 & 56 & 57 & 58 & 59 & 60 & 61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 & 73 & 74 & 75 & 76 & 78 & 79 & 80 & 81 & 84 \tabularnewline
0 & 0.44 & 0.44 & 0.44 & 0.87 & 1.31 & 0.44 & 1.31 & 1.31 & 0.87 & 0.87 & 0.87 & 2.18 & 1.31 & 2.18 & 2.62 & 4.8 & 5.24 & 2.18 & 4.36 & 3.06 & 3.49 & 5.67 & 6.55 & 4.36 & 5.24 & 5.67 & 5.67 & 6.11 & 4.36 & 3.93 & 3.49 & 3.06 & 2.18 & 2.62 & 0.87 & 0.87 & 0.87 & 0.87 \tabularnewline
1 & 0.56 & 0.56 & 0.56 & 1.13 & 1.69 & 0.56 & 1.69 & 1.69 & 1.13 & 1.13 & 1.13 & 2.82 & 1.69 & 2.82 & 3.38 & 6.2 & 6.76 & 2.82 & 5.64 & 3.94 & 4.51 & 7.33 & 8.45 & 5.64 & 6.76 & 7.33 & 7.33 & 7.89 & 5.64 & 5.07 & 4.51 & 3.94 & 2.82 & 3.38 & 1.13 & 1.13 & 1.13 & 1.13 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=268920&T=2

[TABLE]
[ROW]Tabulation of Expected Results[/C][/ROW]
[ROW]s/b_(s_=_1)  x  AMS.E[/C][/ROW]
[ROW][C] [/C][C]19[/C][C]32[/C][C]42[/C][C]47[/C][C]48[/C][C]49[/C][C]50[/C][C]51[/C][C]52[/C][C]53[/C][C]54[/C][C]55[/C][C]56[/C][C]57[/C][C]58[/C][C]59[/C][C]60[/C][C]61[/C][C]62[/C][C]63[/C][C]64[/C][C]65[/C][C]66[/C][C]67[/C][C]68[/C][C]69[/C][C]70[/C][C]71[/C][C]72[/C][C]73[/C][C]74[/C][C]75[/C][C]76[/C][C]78[/C][C]79[/C][C]80[/C][C]81[/C][C]84[/C][/ROW]
[C]0[/C][C]0.44[/C][C]0.44[/C][C]0.44[/C][C]0.87[/C][C]1.31[/C][C]0.44[/C][C]1.31[/C][C]1.31[/C][C]0.87[/C][C]0.87[/C][C]0.87[/C][C]2.18[/C][C]1.31[/C][C]2.18[/C][C]2.62[/C][C]4.8[/C][C]5.24[/C][C]2.18[/C][C]4.36[/C][C]3.06[/C][C]3.49[/C][C]5.67[/C][C]6.55[/C][C]4.36[/C][C]5.24[/C][C]5.67[/C][C]5.67[/C][C]6.11[/C][C]4.36[/C][C]3.93[/C][C]3.49[/C][C]3.06[/C][C]2.18[/C][C]2.62[/C][C]0.87[/C][C]0.87[/C][C]0.87[/C][C]0.87[/C][/ROW]
[C]1[/C][C]0.56[/C][C]0.56[/C][C]0.56[/C][C]1.13[/C][C]1.69[/C][C]0.56[/C][C]1.69[/C][C]1.69[/C][C]1.13[/C][C]1.13[/C][C]1.13[/C][C]2.82[/C][C]1.69[/C][C]2.82[/C][C]3.38[/C][C]6.2[/C][C]6.76[/C][C]2.82[/C][C]5.64[/C][C]3.94[/C][C]4.51[/C][C]7.33[/C][C]8.45[/C][C]5.64[/C][C]6.76[/C][C]7.33[/C][C]7.33[/C][C]7.89[/C][C]5.64[/C][C]5.07[/C][C]4.51[/C][C]3.94[/C][C]2.82[/C][C]3.38[/C][C]1.13[/C][C]1.13[/C][C]1.13[/C][C]1.13[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=268920&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=268920&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
s/b_(s_=_1) x AMS.E
1932424748495051525354555657585960616263646566676869707172737475767879808184
00.440.440.440.871.310.441.311.310.870.870.872.181.312.182.624.85.242.184.363.063.495.676.554.365.245.675.676.114.363.933.493.062.182.620.870.870.870.87
10.560.560.561.131.690.561.691.691.131.131.132.821.692.823.386.26.762.825.643.944.517.338.455.646.767.337.337.895.645.074.513.942.823.381.131.131.131.13







Statistical Results
Pearson's Chi-squared test
Pearson Chi Square Statistic42.93
Degrees of Freedom37
P value0.23

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=268920&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 Statistic42.93
Degrees of Freedom37
P value0.23



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')