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, 18 Dec 2014 13:14:50 +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/18/t1418908519foxdoq8bck86dyf.htm/, Retrieved Sun, 19 May 2024 18:47:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=270899, Retrieved Sun, 19 May 2024 18:47:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact74
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] [Gender ExintricMo...] [2014-12-18 13:14:50] [3bdd9332f2b4587684e97c4d9c2e2a73] [Current]
Feedback Forum

Post a new message
Dataseries X:
0	50
1	62
0	54
1	71
1	54
1	65
0	73
1	52
1	84
1	42
1	66
1	65
1	78
0	73
0	75
0	72
1	66
0	70
1	61
0	81
1	71
1	69
0	71
1	72
1	68
1	70
1	68
0	61
1	67
0	76
0	70
0	60
1	72
1	69
1	71
1	62
0	70
1	64
1	58
0	76
1	52
1	59
1	68
1	76
1	65
0	67
1	59
1	69
0	76
1	63
1	75
1	63
1	60
1	73
1	63
1	70
0	75
1	66
0	63
1	63
1	64
0	70
0	75
1	61
0	60
1	62
0	73
1	61
1	66
0	64
0	59
0	64
0	60
1	56
0	78
1	53
0	67
1	59
0	66
0	68
1	71
0	66
0	73
0	72
1	71
0	59
1	64
1	66
0	78
0	68
0	73
1	62
1	65
1	68
0	65
1	60
0	71
1	65
1	68
1	64
1	74
1	69
0	76
1	68
1	72
1	67
0	63
0	59
0	73
0	66
0	62
0	69
1	66




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270899&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 time2 seconds
R Server'George Udny Yule' @ yule.wessa.net







Tabulation of Results
Gender x ExintricMotivation
42505253545658596061626364656667686970717273747576788184
00100100331122132214226034210
11021111323444562642531111101

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
Gender  x  ExintricMotivation \tabularnewline
  & 42 & 50 & 52 & 53 & 54 & 56 & 58 & 59 & 60 & 61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 & 73 & 74 & 75 & 76 & 78 & 81 & 84 \tabularnewline
0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 3 & 3 & 1 & 1 & 2 & 2 & 1 & 3 & 2 & 2 & 1 & 4 & 2 & 2 & 6 & 0 & 3 & 4 & 2 & 1 & 0 \tabularnewline
1 & 1 & 0 & 2 & 1 & 1 & 1 & 1 & 3 & 2 & 3 & 4 & 4 & 4 & 5 & 6 & 2 & 6 & 4 & 2 & 5 & 3 & 1 & 1 & 1 & 1 & 1 & 0 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=270899&T=1

[TABLE]
[ROW]Tabulation of Results[/C][/ROW]
[ROW]Gender  x  ExintricMotivation[/C][/ROW]
[ROW][C] [/C][C]42[/C][C]50[/C][C]52[/C][C]53[/C][C]54[/C][C]56[/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]81[/C][C]84[/C][/ROW]
[C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]3[/C][C]3[/C][C]1[/C][C]1[/C][C]2[/C][C]2[/C][C]1[/C][C]3[/C][C]2[/C][C]2[/C][C]1[/C][C]4[/C][C]2[/C][C]2[/C][C]6[/C][C]0[/C][C]3[/C][C]4[/C][C]2[/C][C]1[/C][C]0[/C][/ROW]
[C]1[/C][C]1[/C][C]0[/C][C]2[/C][C]1[/C][C]1[/C][C]1[/C][C]1[/C][C]3[/C][C]2[/C][C]3[/C][C]4[/C][C]4[/C][C]4[/C][C]5[/C][C]6[/C][C]2[/C][C]6[/C][C]4[/C][C]2[/C][C]5[/C][C]3[/C][C]1[/C][C]1[/C][C]1[/C][C]1[/C][C]1[/C][C]0[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=270899&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270899&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 ExintricMotivation
42505253545658596061626364656667686970717273747576788184
00100100331122132214226034210
11021111323444562642531111101







Tabulation of Expected Results
Gender x ExintricMotivation
42505253545658596061626364656667686970717273747576788184
00.420.420.830.420.830.420.422.52.081.662.082.52.52.53.741.663.332.082.52.912.082.910.421.662.081.250.420.42
10.580.581.170.581.170.580.583.52.922.342.923.53.53.55.262.344.672.923.54.092.924.090.582.342.921.750.580.58

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
Gender  x  ExintricMotivation \tabularnewline
  & 42 & 50 & 52 & 53 & 54 & 56 & 58 & 59 & 60 & 61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 & 73 & 74 & 75 & 76 & 78 & 81 & 84 \tabularnewline
0 & 0.42 & 0.42 & 0.83 & 0.42 & 0.83 & 0.42 & 0.42 & 2.5 & 2.08 & 1.66 & 2.08 & 2.5 & 2.5 & 2.5 & 3.74 & 1.66 & 3.33 & 2.08 & 2.5 & 2.91 & 2.08 & 2.91 & 0.42 & 1.66 & 2.08 & 1.25 & 0.42 & 0.42 \tabularnewline
1 & 0.58 & 0.58 & 1.17 & 0.58 & 1.17 & 0.58 & 0.58 & 3.5 & 2.92 & 2.34 & 2.92 & 3.5 & 3.5 & 3.5 & 5.26 & 2.34 & 4.67 & 2.92 & 3.5 & 4.09 & 2.92 & 4.09 & 0.58 & 2.34 & 2.92 & 1.75 & 0.58 & 0.58 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=270899&T=2

[TABLE]
[ROW]Tabulation of Expected Results[/C][/ROW]
[ROW]Gender  x  ExintricMotivation[/C][/ROW]
[ROW][C] [/C][C]42[/C][C]50[/C][C]52[/C][C]53[/C][C]54[/C][C]56[/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]81[/C][C]84[/C][/ROW]
[C]0[/C][C]0.42[/C][C]0.42[/C][C]0.83[/C][C]0.42[/C][C]0.83[/C][C]0.42[/C][C]0.42[/C][C]2.5[/C][C]2.08[/C][C]1.66[/C][C]2.08[/C][C]2.5[/C][C]2.5[/C][C]2.5[/C][C]3.74[/C][C]1.66[/C][C]3.33[/C][C]2.08[/C][C]2.5[/C][C]2.91[/C][C]2.08[/C][C]2.91[/C][C]0.42[/C][C]1.66[/C][C]2.08[/C][C]1.25[/C][C]0.42[/C][C]0.42[/C][/ROW]
[C]1[/C][C]0.58[/C][C]0.58[/C][C]1.17[/C][C]0.58[/C][C]1.17[/C][C]0.58[/C][C]0.58[/C][C]3.5[/C][C]2.92[/C][C]2.34[/C][C]2.92[/C][C]3.5[/C][C]3.5[/C][C]3.5[/C][C]5.26[/C][C]2.34[/C][C]4.67[/C][C]2.92[/C][C]3.5[/C][C]4.09[/C][C]2.92[/C][C]4.09[/C][C]0.58[/C][C]2.34[/C][C]2.92[/C][C]1.75[/C][C]0.58[/C][C]0.58[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=270899&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270899&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 ExintricMotivation
42505253545658596061626364656667686970717273747576788184
00.420.420.830.420.830.420.422.52.081.662.082.52.52.53.741.663.332.082.52.912.082.910.421.662.081.250.420.42
10.580.581.170.581.170.580.583.52.922.342.923.53.53.55.262.344.672.923.54.092.924.090.582.342.921.750.580.58







Statistical Results
Pearson's Chi-squared test
Pearson Chi Square Statistic28.26
Degrees of Freedom27
P value0.4

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270899&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 Statistic28.26
Degrees of Freedom27
P value0.4



Parameters (Session):
par1 = 1 ; par2 = 2 ; par3 = Pearson Chi-Squared ;
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')