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, 16 Nov 2011 10:23:12 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Nov/16/t132145699904bly1tn7hofk40.htm/, Retrieved Fri, 19 Apr 2024 13:07:20 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=144044, Retrieved Fri, 19 Apr 2024 13:07:20 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact122
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] [] [2011-11-16 15:23:12] [abd09a04ddc145afbf81a913bd861ab8] [Current]
Feedback Forum

Post a new message
Dataseries X:
14	12	41	38
18	11	39	32
11	14	30	35
12	12	31	33
16	21	34	37
18	12	35	29
14	22	39	31
14	11	34	36
15	10	36	35
15	13	37	38
17	10	38	31
19	8	36	34
10	15	38	35
16	14	39	38
18	10	33	37
14	14	32	33
14	14	36	32
17	11	38	38
14	10	39	38
16	13	32	32
18	7	32	33
11	14	31	31
14	12	39	38
12	14	37	39
17	11	39	32
9	9	41	32
16	11	36	35
14	15	33	37
15	14	33	33
11	13	34	33
16	9	31	28
13	15	27	32
17	10	37	31
15	11	34	37
14	13	34	30
16	8	32	33
9	20	29	31
15	12	36	33
17	10	29	31
13	10	35	33
15	9	37	32
16	14	34	33
16	8	38	32
12	14	35	33
12	11	38	28
11	13	37	35
15	9	38	39
15	11	33	34
17	15	36	38
13	11	38	32
16	10	32	38
14	14	32	30
11	18	32	33
12	14	34	38
12	11	32	32
15	12	37	32
16	13	39	34
15	9	29	34
12	10	37	36
12	15	35	34
8	20	30	28
13	12	38	34
11	12	34	35
14	14	31	35
15	13	34	31
10	11	35	37
11	17	36	35
12	12	30	27
15	13	39	40
15	14	35	37
14	13	38	36
16	15	31	38
15	13	34	39
15	10	38	41
13	11	34	27
12	19	39	30
17	13	37	37
13	17	34	31
15	13	28	31
13	9	37	27
15	11	33	36
16	10	37	38
15	9	35	37
16	12	37	33
15	12	32	34
14	13	33	31
15	13	38	39
14	12	33	34
13	15	29	32
7	22	33	33
17	13	31	36
13	15	36	32
15	13	35	41
14	15	32	28
13	10	29	30
16	11	39	36
12	16	37	35
14	11	35	31
17	11	37	34
15	10	32	36
17	10	38	36
12	16	37	35
16	12	36	37
11	11	32	28
15	16	33	39
9	19	40	32
16	11	38	35
15	16	41	39
10	15	36	35
10	24	43	42
15	14	30	34
11	15	31	33
13	11	32	41
14	15	32	33
18	12	37	34
16	10	37	32
14	14	33	40
14	13	34	40
14	9	33	35
14	15	38	36
12	15	33	37
14	14	31	27
15	11	38	39
15	8	37	38
15	11	33	31
13	11	31	33
17	8	39	32
17	10	44	39
19	11	33	36
15	13	35	33
13	11	32	33
9	20	28	32
15	10	40	37
15	15	27	30
15	12	37	38
16	14	32	29
11	23	28	22
14	14	34	35
11	16	30	35
15	11	35	34
13	12	31	35
15	10	32	34
16	14	30	34
14	12	30	35
15	12	31	23
16	11	40	31
16	12	32	27
11	13	36	36
12	11	32	31
9	19	35	32
16	12	38	39
13	17	42	37
16	9	34	38
12	12	35	39
9	19	35	34
13	18	33	31
13	15	36	32
14	14	32	37
19	11	33	36
13	9	34	32
12	18	32	35
13	16	34	36




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time0 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 & 0 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=144044&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]0 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=144044&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=144044&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 time0 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net



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