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 12:47:01 +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/t1418907075os7kkxjl9dutmas.htm/, Retrieved Fri, 17 May 2024 12:40:36 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=270873, Retrieved Fri, 17 May 2024 12:40:36 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact103
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 IntrinsicM...] [2014-12-18 12:47:01] [3bdd9332f2b4587684e97c4d9c2e2a73] [Current]
Feedback Forum

Post a new message
Dataseries X:
0	26
1	57
0	37
1	67
1	43
1	52
0	52
1	43
1	84
1	67
1	49
1	70
1	52
0	58
0	68
0	62
1	43
0	56
1	56
0	74
1	65
1	63
0	58
1	57
1	63
1	53
1	57
0	51
1	64
0	53
0	29
0	54
1	58
1	43
1	51
1	53
0	54
1	56
1	61
0	47
1	39
1	48
1	50
1	35
1	30
0	68
1	49
1	61
0	67
1	47
1	56
1	50
1	43
1	67
1	62
1	57
0	41
1	54
0	45
1	48
1	61
0	56
0	41
1	43
0	53
1	44
0	66
1	58
1	46
0	37
0	51
0	51
0	56
1	66
0	37
1	59
0	42
1	38
0	66
0	34
1	53
0	49
0	55
0	49
1	59
0	40
1	58
1	60
0	63
0	56
0	54
1	52
1	34
1	69
0	32
1	48
0	67
1	58
1	57
1	42
1	64
1	58
0	66
1	26
1	61
1	52
0	51
0	55
0	50
0	60
0	56
0	63
1	61




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

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







Tabulation of Results
Gender x IntrinsicMotivation
262930323435373839404142434445464748495051525354555657585960616263646566676869707484
0110110300121001010214123250201012003220010
1101011011001610113221431035521512211301101

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
Gender  x  IntrinsicMotivation \tabularnewline
  & 26 & 29 & 30 & 32 & 34 & 35 & 37 & 38 & 39 & 40 & 41 & 42 & 43 & 44 & 45 & 46 & 47 & 48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 & 56 & 57 & 58 & 59 & 60 & 61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 74 & 84 \tabularnewline
0 & 1 & 1 & 0 & 1 & 1 & 0 & 3 & 0 & 0 & 1 & 2 & 1 & 0 & 0 & 1 & 0 & 1 & 0 & 2 & 1 & 4 & 1 & 2 & 3 & 2 & 5 & 0 & 2 & 0 & 1 & 0 & 1 & 2 & 0 & 0 & 3 & 2 & 2 & 0 & 0 & 1 & 0 \tabularnewline
1 & 1 & 0 & 1 & 0 & 1 & 1 & 0 & 1 & 1 & 0 & 0 & 1 & 6 & 1 & 0 & 1 & 1 & 3 & 2 & 2 & 1 & 4 & 3 & 1 & 0 & 3 & 5 & 5 & 2 & 1 & 5 & 1 & 2 & 2 & 1 & 1 & 3 & 0 & 1 & 1 & 0 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=270873&T=1

[TABLE]
[ROW]Tabulation of Results[/C][/ROW]
[ROW]Gender  x  IntrinsicMotivation[/C][/ROW]
[ROW][C] [/C][C]26[/C][C]29[/C][C]30[/C][C]32[/C][C]34[/C][C]35[/C][C]37[/C][C]38[/C][C]39[/C][C]40[/C][C]41[/C][C]42[/C][C]43[/C][C]44[/C][C]45[/C][C]46[/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]74[/C][C]84[/C][/ROW]
[C]0[/C][C]1[/C][C]1[/C][C]0[/C][C]1[/C][C]1[/C][C]0[/C][C]3[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]1[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]1[/C][C]0[/C][C]2[/C][C]1[/C][C]4[/C][C]1[/C][C]2[/C][C]3[/C][C]2[/C][C]5[/C][C]0[/C][C]2[/C][C]0[/C][C]1[/C][C]0[/C][C]1[/C][C]2[/C][C]0[/C][C]0[/C][C]3[/C][C]2[/C][C]2[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[C]1[/C][C]1[/C][C]0[/C][C]1[/C][C]0[/C][C]1[/C][C]1[/C][C]0[/C][C]1[/C][C]1[/C][C]0[/C][C]0[/C][C]1[/C][C]6[/C][C]1[/C][C]0[/C][C]1[/C][C]1[/C][C]3[/C][C]2[/C][C]2[/C][C]1[/C][C]4[/C][C]3[/C][C]1[/C][C]0[/C][C]3[/C][C]5[/C][C]5[/C][C]2[/C][C]1[/C][C]5[/C][C]1[/C][C]2[/C][C]2[/C][C]1[/C][C]1[/C][C]3[/C][C]0[/C][C]1[/C][C]1[/C][C]0[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=270873&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270873&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 IntrinsicMotivation
262930323435373839404142434445464748495051525354555657585960616263646566676869707484
0110110300121001010214123250201012003220010
1101011011001610113221431035521512211301101







Tabulation of Expected Results
Gender x IntrinsicMotivation
262930323435373839404142434445464748495051525354555657585960616263646566676869707484
00.830.420.420.420.830.421.250.420.420.420.830.832.50.420.420.420.831.251.661.252.082.082.081.660.833.332.082.910.830.832.080.831.660.830.421.662.080.830.420.420.420.42
11.170.580.580.581.170.581.750.580.580.581.171.173.50.580.580.581.171.752.341.752.922.922.922.341.174.672.924.091.171.172.921.172.341.170.582.342.921.170.580.580.580.58

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
Gender  x  IntrinsicMotivation \tabularnewline
  & 26 & 29 & 30 & 32 & 34 & 35 & 37 & 38 & 39 & 40 & 41 & 42 & 43 & 44 & 45 & 46 & 47 & 48 & 49 & 50 & 51 & 52 & 53 & 54 & 55 & 56 & 57 & 58 & 59 & 60 & 61 & 62 & 63 & 64 & 65 & 66 & 67 & 68 & 69 & 70 & 74 & 84 \tabularnewline
0 & 0.83 & 0.42 & 0.42 & 0.42 & 0.83 & 0.42 & 1.25 & 0.42 & 0.42 & 0.42 & 0.83 & 0.83 & 2.5 & 0.42 & 0.42 & 0.42 & 0.83 & 1.25 & 1.66 & 1.25 & 2.08 & 2.08 & 2.08 & 1.66 & 0.83 & 3.33 & 2.08 & 2.91 & 0.83 & 0.83 & 2.08 & 0.83 & 1.66 & 0.83 & 0.42 & 1.66 & 2.08 & 0.83 & 0.42 & 0.42 & 0.42 & 0.42 \tabularnewline
1 & 1.17 & 0.58 & 0.58 & 0.58 & 1.17 & 0.58 & 1.75 & 0.58 & 0.58 & 0.58 & 1.17 & 1.17 & 3.5 & 0.58 & 0.58 & 0.58 & 1.17 & 1.75 & 2.34 & 1.75 & 2.92 & 2.92 & 2.92 & 2.34 & 1.17 & 4.67 & 2.92 & 4.09 & 1.17 & 1.17 & 2.92 & 1.17 & 2.34 & 1.17 & 0.58 & 2.34 & 2.92 & 1.17 & 0.58 & 0.58 & 0.58 & 0.58 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=270873&T=2

[TABLE]
[ROW]Tabulation of Expected Results[/C][/ROW]
[ROW]Gender  x  IntrinsicMotivation[/C][/ROW]
[ROW][C] [/C][C]26[/C][C]29[/C][C]30[/C][C]32[/C][C]34[/C][C]35[/C][C]37[/C][C]38[/C][C]39[/C][C]40[/C][C]41[/C][C]42[/C][C]43[/C][C]44[/C][C]45[/C][C]46[/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]74[/C][C]84[/C][/ROW]
[C]0[/C][C]0.83[/C][C]0.42[/C][C]0.42[/C][C]0.42[/C][C]0.83[/C][C]0.42[/C][C]1.25[/C][C]0.42[/C][C]0.42[/C][C]0.42[/C][C]0.83[/C][C]0.83[/C][C]2.5[/C][C]0.42[/C][C]0.42[/C][C]0.42[/C][C]0.83[/C][C]1.25[/C][C]1.66[/C][C]1.25[/C][C]2.08[/C][C]2.08[/C][C]2.08[/C][C]1.66[/C][C]0.83[/C][C]3.33[/C][C]2.08[/C][C]2.91[/C][C]0.83[/C][C]0.83[/C][C]2.08[/C][C]0.83[/C][C]1.66[/C][C]0.83[/C][C]0.42[/C][C]1.66[/C][C]2.08[/C][C]0.83[/C][C]0.42[/C][C]0.42[/C][C]0.42[/C][C]0.42[/C][/ROW]
[C]1[/C][C]1.17[/C][C]0.58[/C][C]0.58[/C][C]0.58[/C][C]1.17[/C][C]0.58[/C][C]1.75[/C][C]0.58[/C][C]0.58[/C][C]0.58[/C][C]1.17[/C][C]1.17[/C][C]3.5[/C][C]0.58[/C][C]0.58[/C][C]0.58[/C][C]1.17[/C][C]1.75[/C][C]2.34[/C][C]1.75[/C][C]2.92[/C][C]2.92[/C][C]2.92[/C][C]2.34[/C][C]1.17[/C][C]4.67[/C][C]2.92[/C][C]4.09[/C][C]1.17[/C][C]1.17[/C][C]2.92[/C][C]1.17[/C][C]2.34[/C][C]1.17[/C][C]0.58[/C][C]2.34[/C][C]2.92[/C][C]1.17[/C][C]0.58[/C][C]0.58[/C][C]0.58[/C][C]0.58[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=270873&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270873&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 IntrinsicMotivation
262930323435373839404142434445464748495051525354555657585960616263646566676869707484
00.830.420.420.420.830.421.250.420.420.420.830.832.50.420.420.420.831.251.661.252.082.082.081.660.833.332.082.910.830.832.080.831.660.830.421.662.080.830.420.420.420.42
11.170.580.580.581.170.581.750.580.580.581.171.173.50.580.580.581.171.752.341.752.922.922.922.341.174.672.924.091.171.172.921.172.341.170.582.342.921.170.580.580.580.58







Statistical Results
Pearson's Chi-squared test
Pearson Chi Square Statistic53.44
Degrees of Freedom41
P value0.09

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=270873&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 Statistic53.44
Degrees of Freedom41
P value0.09



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