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 and McNemar Tests
Date of computationSun, 07 Nov 2010 12:19:27 +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/Nov/07/t128913234652tsotgupaxm31h.htm/, Retrieved Sat, 04 May 2024 01:11:26 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=92531, Retrieved Sat, 04 May 2024 01:11:26 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact172
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Chi-Squared and McNemar Tests] [Chi Geslacht Conn...] [2010-11-07 12:19:27] [18ef3d986e8801a4b28404e69e5bf56b] [Current]
Feedback Forum

Post a new message
Dataseries X:
2	41	'A'	'HI'
2	39	'A'	'HI'
2	30	'D'	'LO'
1	31	'D'	'LO'
2	34	'B'	'HI'
2	35	'B'	'HI'
2	39	'A'	'HI'
2	34	'B'	'HI'
2	36	'B'	'HI'
2	37	'A'	'HI'
1	38	'A'	'HI'
2	36	'B'	'HI'
1	38	'A'	'HI'
2	39	'A'	'HI'
2	33	'C'	'LO'
1	32	'C'	'LO'
1	36	'B'	'HI'
2	38	'A'	'HI'
1	39	'A'	'HI'
2	32	'C'	'LO'
1	32	'C'	'LO'
2	31	'D'	'LO'
2	39	'A'	'HI'
2	37	'A'	'HI'
1	39	'A'	'HI'
2	41	'A'	'HI'
1	36	'B'	'HI'
2	33	'C'	'LO'
2	33	'C'	'LO'
1	34	'B'	'HI'
2	31	'D'	'LO'
1	27	'D'	'LO'
2	37	'A'	'HI'
2	34	'B'	'HI'
1	34	'B'	'HI'
1	32	'C'	'LO'
1	29	'D'	'LO'
1	36	'B'	'HI'
2	29	'D'	'LO'
1	35	'B'	'HI'
1	37	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	38	'A'	'HI'
2	33	'C'	'LO'
2	31	'D'	'LO'
2	38	'A'	'HI'
2	37	'A'	'HI'
2	33	'C'	'LO'
2	31	'D'	'LO'
1	39	'A'	'HI'
2	44	'A'	'HI'
2	33	'C'	'LO'
2	35	'B'	'HI'
1	32	'C'	'LO'
1	28	'D'	'LO'
2	40	'A'	'HI'
1	27	'D'	'LO'
1	37	'A'	'HI'
2	32	'C'	'LO'
1	28	'D'	'LO'
1	34	'B'	'HI'
2	30	'D'	'LO'
2	35	'B'	'HI'
1	31	'D'	'LO'
2	32	'C'	'LO'
1	30	'D'	'LO'
2	30	'D'	'LO'
1	31	'D'	'LO'
2	40	'A'	'HI'
2	32	'C'	'LO'
1	36	'B'	'HI'
1	32	'C'	'LO'
1	35	'B'	'HI'
2	38	'A'	'HI'
2	42	'A'	'HI'
1	34	'B'	'HI'
2	35	'B'	'HI'
2	35	'B'	'HI'
2	33	'C'	'LO'
2	36	'B'	'HI'
2	32	'C'	'LO'
2	33	'C'	'LO'
2	34	'B'	'HI'
2	32	'C'	'LO'
2	34	'B'	'HI'




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\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 & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=92531&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]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=92531&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=92531&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'RServer@AstonUniversity' @ vre.aston.ac.uk







Tabulation of Results
Geslact x Score
272829303132333435363738394041424344
12313311155598311000
2004481015129798822111

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline Geslact x Score \tabularnewline & 27 & 28 & 29 & 30 & 31 & 32 & 33 & 34 & 35 & 36 & 37 & 38 & 39 & 40 & 41 & 42 & 43 & 44 \tabularnewline 1 & 2 & 3 & 1 & 3 & 3 & 11 & 1 & 5 & 5 & 5 & 9 & 8 & 3 & 1 & 1 & 0 & 0 & 0 \tabularnewline 2 & 0 & 0 & 4 & 4 & 8 & 10 & 15 & 12 & 9 & 7 & 9 & 8 & 8 & 2 & 2 & 1 & 1 & 1 \tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=92531&T=1

[TABLE]
[ROW]
Tabulation of Results[/C][/ROW] [ROW]Geslact x Score[/C][/ROW] [ROW][C] [/C][C]27[/C][C]28[/C][C]29[/C][C]30[/C][C]31[/C][C]32[/C][C]33[/C][C]34[/C][C]35[/C][C]36[/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][/ROW] [C]1[/C][C]2[/C][C]3[/C][C]1[/C][C]3[/C][C]3[/C][C]11[/C][C]1[/C][C]5[/C][C]5[/C][C]5[/C][C]9[/C][C]8[/C][C]3[/C][C]1[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [C]2[/C][C]0[/C][C]0[/C][C]4[/C][C]4[/C][C]8[/C][C]10[/C][C]15[/C][C]12[/C][C]9[/C][C]7[/C][C]9[/C][C]8[/C][C]8[/C][C]2[/C][C]2[/C][C]1[/C][C]1[/C][C]1[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=92531&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=92531&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
Geslact x Score
272829303132333435363738394041424344
12313311155598311000
2004481015129798822111







Tabulation of Expected Results
Geslact x Score
272829303132333435363738394041424344
10.751.131.882.644.147.916.026.45.274.526.786.024.141.131.130.380.380.38
21.251.873.124.366.8613.099.9810.68.737.4811.229.986.861.871.870.620.620.62

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline Geslact x Score \tabularnewline & 27 & 28 & 29 & 30 & 31 & 32 & 33 & 34 & 35 & 36 & 37 & 38 & 39 & 40 & 41 & 42 & 43 & 44 \tabularnewline 1 & 0.75 & 1.13 & 1.88 & 2.64 & 4.14 & 7.91 & 6.02 & 6.4 & 5.27 & 4.52 & 6.78 & 6.02 & 4.14 & 1.13 & 1.13 & 0.38 & 0.38 & 0.38 \tabularnewline 2 & 1.25 & 1.87 & 3.12 & 4.36 & 6.86 & 13.09 & 9.98 & 10.6 & 8.73 & 7.48 & 11.22 & 9.98 & 6.86 & 1.87 & 1.87 & 0.62 & 0.62 & 0.62 \tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=92531&T=2

[TABLE]
[ROW]
Tabulation of Expected Results[/C][/ROW] [ROW]Geslact x Score[/C][/ROW] [ROW][C] [/C][C]27[/C][C]28[/C][C]29[/C][C]30[/C][C]31[/C][C]32[/C][C]33[/C][C]34[/C][C]35[/C][C]36[/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][/ROW] [C]1[/C][C]0.75[/C][C]1.13[/C][C]1.88[/C][C]2.64[/C][C]4.14[/C][C]7.91[/C][C]6.02[/C][C]6.4[/C][C]5.27[/C][C]4.52[/C][C]6.78[/C][C]6.02[/C][C]4.14[/C][C]1.13[/C][C]1.13[/C][C]0.38[/C][C]0.38[/C][C]0.38[/C][/ROW] [C]2[/C][C]1.25[/C][C]1.87[/C][C]3.12[/C][C]4.36[/C][C]6.86[/C][C]13.09[/C][C]9.98[/C][C]10.6[/C][C]8.73[/C][C]7.48[/C][C]11.22[/C][C]9.98[/C][C]6.86[/C][C]1.87[/C][C]1.87[/C][C]0.62[/C][C]0.62[/C][C]0.62[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=92531&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=92531&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
Geslact x Score
272829303132333435363738394041424344
10.751.131.882.644.147.916.026.45.274.526.786.024.141.131.130.380.380.38
21.251.873.124.366.8613.099.9810.68.737.4811.229.986.861.871.870.620.620.62







Statistical Results
Pearson's Chi-squared test
Chi Square Statistic23.36
Degrees of Freedom17
P value0.14

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=92531&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 Statistic23.36
Degrees of Freedom17
P value0.14



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