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, 15 Dec 2016 21:18:40 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/15/t14818332927tejg6f97y1wh6z.htm/, Retrieved Fri, 03 May 2024 09:00:15 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=299995, Retrieved Fri, 03 May 2024 09:00:15 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact76
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] [Chi-Squared Test ...] [2016-12-15 20:18:40] [6fe662842930c5949e61d44eeb8a265b] [Current]
Feedback Forum

Post a new message
Dataseries X:
22	13
24	16
26	17
25	16
28	17
23	17
25	15
24	16
24	14
24	16
25	17
24	16
26	16
24	16
24	15
25	16
25	16
24	13
28	15
27	17
23	13
23	17
24	14
22	14
25	18
28	17
22	13
28	16
25	15
24	15
23	15
25	13
26	17
26	11
23	14
25	13
22	17
24	16
27	17
24	16
26	16
21	16
27	15
22	12
23	17
24	14
25	14
24	16
22	15
25	16
25	14
24	15
24	17
21	10
25	17
25	20
26	17
27	18
20	14
26	17
25	17
26	16
25	18
28	18
27	16
26	15
26	13
25	16
23	12
24	16
24	16
28	16
23	14
24	15
23	14
25	15
23	15
23	16
19	11
25	18
22	11
27	18
26	15
29	19
28	17
25	14
22	13
25	17
26	14
26	19
24	14
25	16
23	16
25	15
25	12
27	17
25	18
24	15
23	18
27	15
25	16
23	16




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299995&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=299995&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299995&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







Tabulation of Results
Usability x Tevredenheid
1011121314151617181920
1901000000000
2000001000000
2110000010000
2201131101000
2300113233100
24000145101000
2500123474401
2601011234010
2700000213200
2800000123100
2900000000010

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
Usability  x  Tevredenheid \tabularnewline
  & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 \tabularnewline
19 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
20 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
21 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \tabularnewline
22 & 0 & 1 & 1 & 3 & 1 & 1 & 0 & 1 & 0 & 0 & 0 \tabularnewline
23 & 0 & 0 & 1 & 1 & 3 & 2 & 3 & 3 & 1 & 0 & 0 \tabularnewline
24 & 0 & 0 & 0 & 1 & 4 & 5 & 10 & 1 & 0 & 0 & 0 \tabularnewline
25 & 0 & 0 & 1 & 2 & 3 & 4 & 7 & 4 & 4 & 0 & 1 \tabularnewline
26 & 0 & 1 & 0 & 1 & 1 & 2 & 3 & 4 & 0 & 1 & 0 \tabularnewline
27 & 0 & 0 & 0 & 0 & 0 & 2 & 1 & 3 & 2 & 0 & 0 \tabularnewline
28 & 0 & 0 & 0 & 0 & 0 & 1 & 2 & 3 & 1 & 0 & 0 \tabularnewline
29 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299995&T=1

[TABLE]
[ROW][C]Tabulation of Results[/C][/ROW]
[ROW][C]Usability  x  Tevredenheid[/C][/ROW]
[ROW][C] [/C][C]10[/C][C]11[/C][C]12[/C][C]13[/C][C]14[/C][C]15[/C][C]16[/C][C]17[/C][C]18[/C][C]19[/C][C]20[/C][/ROW]
[C]19[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]20[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]21[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]22[/C][C]0[/C][C]1[/C][C]1[/C][C]3[/C][C]1[/C][C]1[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]23[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][C]3[/C][C]2[/C][C]3[/C][C]3[/C][C]1[/C][C]0[/C][C]0[/C][/ROW]
[C]24[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]4[/C][C]5[/C][C]10[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]25[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]3[/C][C]4[/C][C]7[/C][C]4[/C][C]4[/C][C]0[/C][C]1[/C][/ROW]
[C]26[/C][C]0[/C][C]1[/C][C]0[/C][C]1[/C][C]1[/C][C]2[/C][C]3[/C][C]4[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[C]27[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]2[/C][C]1[/C][C]3[/C][C]2[/C][C]0[/C][C]0[/C][/ROW]
[C]28[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]3[/C][C]1[/C][C]0[/C][C]0[/C][/ROW]
[C]29[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299995&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299995&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
Usability x Tevredenheid
1011121314151617181920
1901000000000
2000001000000
2110000010000
2201131101000
2300113233100
24000145101000
2500123474401
2601011234010
2700000213200
2800000123100
2900000000010







Tabulation of Expected Results
Usability x Tevredenheid
1011121314151617181920
190.010.030.030.080.130.170.260.190.080.020.01
200.010.030.030.080.130.170.260.190.080.020.01
210.020.060.060.160.250.330.530.370.160.040.02
220.080.240.240.631.021.332.121.490.630.160.08
230.140.410.411.11.782.333.712.611.10.270.14
240.210.620.621.652.683.55.563.911.650.410.21
250.250.760.762.043.314.336.884.842.040.510.25
260.130.380.381.021.662.173.442.421.020.250.13
270.080.240.240.631.021.332.121.490.630.160.08
280.070.210.210.550.891.171.851.30.550.140.07
290.010.030.030.080.130.170.260.190.080.020.01

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
Usability  x  Tevredenheid \tabularnewline
  & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 \tabularnewline
19 & 0.01 & 0.03 & 0.03 & 0.08 & 0.13 & 0.17 & 0.26 & 0.19 & 0.08 & 0.02 & 0.01 \tabularnewline
20 & 0.01 & 0.03 & 0.03 & 0.08 & 0.13 & 0.17 & 0.26 & 0.19 & 0.08 & 0.02 & 0.01 \tabularnewline
21 & 0.02 & 0.06 & 0.06 & 0.16 & 0.25 & 0.33 & 0.53 & 0.37 & 0.16 & 0.04 & 0.02 \tabularnewline
22 & 0.08 & 0.24 & 0.24 & 0.63 & 1.02 & 1.33 & 2.12 & 1.49 & 0.63 & 0.16 & 0.08 \tabularnewline
23 & 0.14 & 0.41 & 0.41 & 1.1 & 1.78 & 2.33 & 3.71 & 2.61 & 1.1 & 0.27 & 0.14 \tabularnewline
24 & 0.21 & 0.62 & 0.62 & 1.65 & 2.68 & 3.5 & 5.56 & 3.91 & 1.65 & 0.41 & 0.21 \tabularnewline
25 & 0.25 & 0.76 & 0.76 & 2.04 & 3.31 & 4.33 & 6.88 & 4.84 & 2.04 & 0.51 & 0.25 \tabularnewline
26 & 0.13 & 0.38 & 0.38 & 1.02 & 1.66 & 2.17 & 3.44 & 2.42 & 1.02 & 0.25 & 0.13 \tabularnewline
27 & 0.08 & 0.24 & 0.24 & 0.63 & 1.02 & 1.33 & 2.12 & 1.49 & 0.63 & 0.16 & 0.08 \tabularnewline
28 & 0.07 & 0.21 & 0.21 & 0.55 & 0.89 & 1.17 & 1.85 & 1.3 & 0.55 & 0.14 & 0.07 \tabularnewline
29 & 0.01 & 0.03 & 0.03 & 0.08 & 0.13 & 0.17 & 0.26 & 0.19 & 0.08 & 0.02 & 0.01 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299995&T=2

[TABLE]
[ROW][C]Tabulation of Expected Results[/C][/ROW]
[ROW][C]Usability  x  Tevredenheid[/C][/ROW]
[ROW][C] [/C][C]10[/C][C]11[/C][C]12[/C][C]13[/C][C]14[/C][C]15[/C][C]16[/C][C]17[/C][C]18[/C][C]19[/C][C]20[/C][/ROW]
[C]19[/C][C]0.01[/C][C]0.03[/C][C]0.03[/C][C]0.08[/C][C]0.13[/C][C]0.17[/C][C]0.26[/C][C]0.19[/C][C]0.08[/C][C]0.02[/C][C]0.01[/C][/ROW]
[C]20[/C][C]0.01[/C][C]0.03[/C][C]0.03[/C][C]0.08[/C][C]0.13[/C][C]0.17[/C][C]0.26[/C][C]0.19[/C][C]0.08[/C][C]0.02[/C][C]0.01[/C][/ROW]
[C]21[/C][C]0.02[/C][C]0.06[/C][C]0.06[/C][C]0.16[/C][C]0.25[/C][C]0.33[/C][C]0.53[/C][C]0.37[/C][C]0.16[/C][C]0.04[/C][C]0.02[/C][/ROW]
[C]22[/C][C]0.08[/C][C]0.24[/C][C]0.24[/C][C]0.63[/C][C]1.02[/C][C]1.33[/C][C]2.12[/C][C]1.49[/C][C]0.63[/C][C]0.16[/C][C]0.08[/C][/ROW]
[C]23[/C][C]0.14[/C][C]0.41[/C][C]0.41[/C][C]1.1[/C][C]1.78[/C][C]2.33[/C][C]3.71[/C][C]2.61[/C][C]1.1[/C][C]0.27[/C][C]0.14[/C][/ROW]
[C]24[/C][C]0.21[/C][C]0.62[/C][C]0.62[/C][C]1.65[/C][C]2.68[/C][C]3.5[/C][C]5.56[/C][C]3.91[/C][C]1.65[/C][C]0.41[/C][C]0.21[/C][/ROW]
[C]25[/C][C]0.25[/C][C]0.76[/C][C]0.76[/C][C]2.04[/C][C]3.31[/C][C]4.33[/C][C]6.88[/C][C]4.84[/C][C]2.04[/C][C]0.51[/C][C]0.25[/C][/ROW]
[C]26[/C][C]0.13[/C][C]0.38[/C][C]0.38[/C][C]1.02[/C][C]1.66[/C][C]2.17[/C][C]3.44[/C][C]2.42[/C][C]1.02[/C][C]0.25[/C][C]0.13[/C][/ROW]
[C]27[/C][C]0.08[/C][C]0.24[/C][C]0.24[/C][C]0.63[/C][C]1.02[/C][C]1.33[/C][C]2.12[/C][C]1.49[/C][C]0.63[/C][C]0.16[/C][C]0.08[/C][/ROW]
[C]28[/C][C]0.07[/C][C]0.21[/C][C]0.21[/C][C]0.55[/C][C]0.89[/C][C]1.17[/C][C]1.85[/C][C]1.3[/C][C]0.55[/C][C]0.14[/C][C]0.07[/C][/ROW]
[C]29[/C][C]0.01[/C][C]0.03[/C][C]0.03[/C][C]0.08[/C][C]0.13[/C][C]0.17[/C][C]0.26[/C][C]0.19[/C][C]0.08[/C][C]0.02[/C][C]0.01[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299995&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299995&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
Usability x Tevredenheid
1011121314151617181920
190.010.030.030.080.130.170.260.190.080.020.01
200.010.030.030.080.130.170.260.190.080.020.01
210.020.060.060.160.250.330.530.370.160.040.02
220.080.240.240.631.021.332.121.490.630.160.08
230.140.410.411.11.782.333.712.611.10.270.14
240.210.620.621.652.683.55.563.911.650.410.21
250.250.760.762.043.314.336.884.842.040.510.25
260.130.380.381.021.662.173.442.421.020.250.13
270.080.240.240.631.021.332.121.490.630.160.08
280.070.210.210.550.891.171.851.30.550.140.07
290.010.030.030.080.130.170.260.190.080.020.01







Statistical Results
Pearson's Chi-squared test with simulated p-value (based on 2000 replicates)
Exact Pearson Chi Square Statistic196.53
P value0.01

\begin{tabular}{lllllllll}
\hline
Statistical Results \tabularnewline
Pearson's Chi-squared test with simulated p-value
	 (based on 2000 replicates) \tabularnewline
Exact Pearson Chi Square Statistic & 196.53 \tabularnewline
P value & 0.01 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299995&T=3

[TABLE]
[ROW][C]Statistical Results[/C][/ROW]
[ROW][C]Pearson's Chi-squared test with simulated p-value
	 (based on 2000 replicates)[/C][/ROW]
[ROW][C]Exact Pearson Chi Square Statistic[/C][C]196.53[/C][/ROW]
[ROW][C]P value[/C][C]0.01[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299995&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299995&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 with simulated p-value (based on 2000 replicates)
Exact Pearson Chi Square Statistic196.53
P value0.01



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