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, 16 Dec 2010 19:11:08 +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/2010/Dec/16/t1292526588kbgujtpapr4v6a1.htm/, Retrieved Fri, 03 May 2024 11:35:29 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=111205, Retrieved Fri, 03 May 2024 11:35:29 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact147
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Chi-Squared and McNemar Tests] [WS6: Chi-squared a] [2010-11-06 09:29:13] [1fd136673b2a4fecb5c545b9b4a05d64]
-       [Chi-Squared and McNemar Tests] [ws6.a happiness-d...] [2010-11-15 07:08:16] [e4076051fbfb461c886b1e223cd7862f]
-    D      [Chi-Squared Test, McNemar Test, and Fisher Exact Test] [PAPER BAEYENS (Ch...] [2010-12-16 19:11:08] [2953e4eb3235e2fd3d6373a16d27c72f] [Current]
Feedback Forum

Post a new message
Dataseries X:
'C'	'B'
'C'	'A'
'C'	'A'
'C'	'B'
'B'	'A'
'C'	'A'
'C'	'B'
'B'	'A'
'C'	'C'
'C'	'A'
'C'	'B'
'C'	'B'
'C'	'B'
'B'	'B'
'C'	'A'
'C'	'A'
'B'	'B'
'C'	'B'
'C'	'A'
'B'	'A'
'C'	'A'
'C'	'B'
'C'	'B'
'C'	'B'
'C'	'A'
'C'	'B'
'B'	'B'
'C'	'C'
'C'	'A'
'D'	'B'
'C'	'A'
'C'	'B'
'C'	'B'
'C'	'A'
'B'	'B'
'D'	'C'
'C'	'B'
'B'	'B'
'C'	'A'
'D'	'C'
'C'	'A'
'C'	'A'
'A'	'A'
'B'	'A'
'C'	'A'
'D'	'B'
'D'	'D'
'B'	'A'
'B'	'A'
'C'	'A'
'B'	'B'
'B'	'B'
'C'	'A'
'B'	'A'
'C'	'A'
'C'	'C'
'C'	'A'
'D'	'B'
'B'	'B'
'C'	'A'
'B'	'A'
'D'	'C'
'C'	'A'
'D'	'A'
'B'	'B'
'C'	'B'
'C'	'C'
'C'	'A'
'C'	'B'
'A'	'B'
'C'	'C'
'C'	'C'
'C'	'B'
'C'	'B'
'C'	'B'
'C'	'B'
'C'	'B'
'C'	'A'
'C'	'B'
'B'	'A'
'B'	'A'
'C'	'C'
'C'	'B'
'B'	'B'
'C'	'C'
'C'	'B'
'B'	'B'
'C'	'A'
'D'	'A'
'B'	'B'
'C'	'B'
'B'	'B'
'D'	'B'
'C'	'B'
'C'	'B'
'B'	'A'
'B'	'A'
'B'	'B'
'C'	'B'
'C'	'B'
'D'	'B'
'D'	'B'
'C'	'A'
'C'	'A'
'A'	'A'
'C'	'B'
'B'	'B'
'C'	'B'
'B'	'A'
'B'	'A'
'C'	'A'
'C'	'A'
'C'	'A'
'C'	'A'
'C'	'B'
'D'	'B'
'D'	'A'
'C'	'B'
'C'	'C'
'C'	'B'
'C'	'B'
'C'	'A'
'B'	'C'
'C'	'B'
'D'	'B'
'C'	'A'
'D'	'B'
'C'	'A'
'C'	'B'
'A'	'A'
'D'	'D'
'C'	'B'
'B'	'A'
'C'	'B'
'C'	'A'
'C'	'A'
'C'	'B'
'B'	'A'
'D'	'B'
'C'	'C'
'C'	'A'
'C'	'A'
'C'	'A'
'B'	'C'
'C'	'A'
'B'	'A'
'B'	'A'
'B'	'C'
'C'	'B'
'D'	'A'
'C'	'B'
'D'	'B'
'B'	'A'
'C'	'A'
'C'	'C'
'C'	'B'




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 3 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111205&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111205&T=0

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







Tabulation of Results
IEP x WP
ABCD
A3100
B191530
C4143110
D41132

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
IEP  x  WP \tabularnewline
  & A & B & C & D \tabularnewline
A & 3 & 1 & 0 & 0 \tabularnewline
B & 19 & 15 & 3 & 0 \tabularnewline
C & 41 & 43 & 11 & 0 \tabularnewline
D & 4 & 11 & 3 & 2 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111205&T=1

[TABLE]
[ROW][C]Tabulation of Results[/C][/ROW]
[ROW][C]IEP  x  WP[/C][/ROW]
[ROW][C] [/C][C]A[/C][C]B[/C][C]C[/C][C]D[/C][/ROW]
[C]A[/C][C]3[/C][C]1[/C][C]0[/C][C]0[/C][/ROW]
[C]B[/C][C]19[/C][C]15[/C][C]3[/C][C]0[/C][/ROW]
[C]C[/C][C]41[/C][C]43[/C][C]11[/C][C]0[/C][/ROW]
[C]D[/C][C]4[/C][C]11[/C][C]3[/C][C]2[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111205&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111205&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
IEP x WP
ABCD
A3100
B191530
C4143110
D41132







Tabulation of Expected Results
IEP x WP
ABCD
A1.721.790.440.05
B15.8916.64.030.47
C40.842.6310.351.22
D8.598.972.180.26

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
IEP  x  WP \tabularnewline
  & A & B & C & D \tabularnewline
A & 1.72 & 1.79 & 0.44 & 0.05 \tabularnewline
B & 15.89 & 16.6 & 4.03 & 0.47 \tabularnewline
C & 40.8 & 42.63 & 10.35 & 1.22 \tabularnewline
D & 8.59 & 8.97 & 2.18 & 0.26 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111205&T=2

[TABLE]
[ROW][C]Tabulation of Expected Results[/C][/ROW]
[ROW][C]IEP  x  WP[/C][/ROW]
[ROW][C] [/C][C]A[/C][C]B[/C][C]C[/C][C]D[/C][/ROW]
[C]A[/C][C]1.72[/C][C]1.79[/C][C]0.44[/C][C]0.05[/C][/ROW]
[C]B[/C][C]15.89[/C][C]16.6[/C][C]4.03[/C][C]0.47[/C][/ROW]
[C]C[/C][C]40.8[/C][C]42.63[/C][C]10.35[/C][C]1.22[/C][/ROW]
[C]D[/C][C]8.59[/C][C]8.97[/C][C]2.18[/C][C]0.26[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111205&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111205&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
IEP x WP
ABCD
A1.721.790.440.05
B15.8916.64.030.47
C40.842.6310.351.22
D8.598.972.180.26







Statistical Results
Pearson's Chi-squared test
Chi Square Statistic19.64
Degrees of Freedom9
P value0.02

\begin{tabular}{lllllllll}
\hline
Statistical Results \tabularnewline
Pearson's Chi-squared test \tabularnewline
Chi Square Statistic & 19.64 \tabularnewline
Degrees of Freedom & 9 \tabularnewline
P value & 0.02 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111205&T=3

[TABLE]
[ROW][C]Statistical Results[/C][/ROW]
[ROW][C]Pearson's Chi-squared test[/C][/ROW]
[ROW][C]Chi Square Statistic[/C][C]19.64[/C][/ROW]
[ROW][C]Degrees of Freedom[/C][C]9[/C][/ROW]
[ROW][C]P value[/C][C]0.02[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111205&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111205&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
Chi Square Statistic19.64
Degrees of Freedom9
P value0.02



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 != 'McNemar Chi-Squared') {
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)
a<-table.element(a, 'Chi Square Statistic', 1, TRUE)
a<-table.element(a, round(cst$statistic, digits=2), 1,FALSE)
a<-table.row.end(a)
if(!simulate.p.value){
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')