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, 19 Dec 2018 14:45:16 +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/2018/Dec/19/t15452299552vviq0jv9pa5l0v.htm/, Retrieved Mon, 29 Apr 2024 20:17:55 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=316095, Retrieved Mon, 29 Apr 2024 20:17:55 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact27
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] [] [2018-12-19 13:45:16] [b533b184177b91add058bbf2204e0bf7] [Current]
Feedback Forum

Post a new message
Dataseries X:
70 1
120 1
70 1
50 1
110 1
110 1
110 1
130 1.33
90 1
90 1
120 1
110 1
120 1
110 1
110 1
110 1
100 1
110 1
110 1
110 1
100 1
110 1
100 1
100 1
110 1
110 1
100 1
120 1.25
120 1.33
110 1
100 1
110 1
100 1
110 1
120 1
120 1
110 1
110 1
110 1
140 1.3
110 1
100 1
110 1
100 1
150 1
150 1
160 1.5
100 1
120 1
140 1.33
90 1
130 1.25
120 1.33
100 1
50 0.5
50 0.5
100 1
100 1
120 1.33
100 1
90 1
110 1
110 1
80 0.83
90 1
90 1
110 1
110 1
90 1
110 1
140 1.5
100 1
110 1
110 1
100 1
100 1
110 1




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time7 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 time7 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=316095&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]7 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=316095&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=316095&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 time7 seconds
R ServerBig Analytics Cloud Computing Center







Tabulation of Results
calories x weight
0.50.8311.251.31.331.5
502010000
700020000
800100000
900070000
10000170000
11000290000
1200061030
1300001010
1400000111
1500020000
1600000001

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
calories  x  weight \tabularnewline
  & 0.5 & 0.83 & 1 & 1.25 & 1.3 & 1.33 & 1.5 \tabularnewline
50 & 2 & 0 & 1 & 0 & 0 & 0 & 0 \tabularnewline
70 & 0 & 0 & 2 & 0 & 0 & 0 & 0 \tabularnewline
80 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \tabularnewline
90 & 0 & 0 & 7 & 0 & 0 & 0 & 0 \tabularnewline
100 & 0 & 0 & 17 & 0 & 0 & 0 & 0 \tabularnewline
110 & 0 & 0 & 29 & 0 & 0 & 0 & 0 \tabularnewline
120 & 0 & 0 & 6 & 1 & 0 & 3 & 0 \tabularnewline
130 & 0 & 0 & 0 & 1 & 0 & 1 & 0 \tabularnewline
140 & 0 & 0 & 0 & 0 & 1 & 1 & 1 \tabularnewline
150 & 0 & 0 & 2 & 0 & 0 & 0 & 0 \tabularnewline
160 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=316095&T=1

[TABLE]
[ROW][C]Tabulation of Results[/C][/ROW]
[ROW][C]calories  x  weight[/C][/ROW]
[ROW][C] [/C][C]0.5[/C][C]0.83[/C][C]1[/C][C]1.25[/C][C]1.3[/C][C]1.33[/C][C]1.5[/C][/ROW]
[C]50[/C][C]2[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]70[/C][C]0[/C][C]0[/C][C]2[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]80[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]90[/C][C]0[/C][C]0[/C][C]7[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]100[/C][C]0[/C][C]0[/C][C]17[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]110[/C][C]0[/C][C]0[/C][C]29[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]120[/C][C]0[/C][C]0[/C][C]6[/C][C]1[/C][C]0[/C][C]3[/C][C]0[/C][/ROW]
[C]130[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[C]140[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[C]150[/C][C]0[/C][C]0[/C][C]2[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]160[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=316095&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=316095&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
calories x weight
0.50.8311.251.31.331.5
502010000
700020000
800100000
900070000
10000170000
11000290000
1200061030
1300001010
1400000111
1500020000
1600000001







Tabulation of Expected Results
calories x weight
0.50.8311.251.31.331.5
500.080.042.490.080.040.190.08
700.050.031.660.050.030.130.05
800.030.010.830.030.010.060.03
900.180.095.820.180.090.450.18
1000.440.2214.130.440.221.10.44
1100.750.3824.10.750.381.880.75
1200.260.138.310.260.130.650.26
1300.050.031.660.050.030.130.05
1400.080.042.490.080.040.190.08
1500.050.031.660.050.030.130.05
1600.030.010.830.030.010.060.03

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
calories  x  weight \tabularnewline
  & 0.5 & 0.83 & 1 & 1.25 & 1.3 & 1.33 & 1.5 \tabularnewline
50 & 0.08 & 0.04 & 2.49 & 0.08 & 0.04 & 0.19 & 0.08 \tabularnewline
70 & 0.05 & 0.03 & 1.66 & 0.05 & 0.03 & 0.13 & 0.05 \tabularnewline
80 & 0.03 & 0.01 & 0.83 & 0.03 & 0.01 & 0.06 & 0.03 \tabularnewline
90 & 0.18 & 0.09 & 5.82 & 0.18 & 0.09 & 0.45 & 0.18 \tabularnewline
100 & 0.44 & 0.22 & 14.13 & 0.44 & 0.22 & 1.1 & 0.44 \tabularnewline
110 & 0.75 & 0.38 & 24.1 & 0.75 & 0.38 & 1.88 & 0.75 \tabularnewline
120 & 0.26 & 0.13 & 8.31 & 0.26 & 0.13 & 0.65 & 0.26 \tabularnewline
130 & 0.05 & 0.03 & 1.66 & 0.05 & 0.03 & 0.13 & 0.05 \tabularnewline
140 & 0.08 & 0.04 & 2.49 & 0.08 & 0.04 & 0.19 & 0.08 \tabularnewline
150 & 0.05 & 0.03 & 1.66 & 0.05 & 0.03 & 0.13 & 0.05 \tabularnewline
160 & 0.03 & 0.01 & 0.83 & 0.03 & 0.01 & 0.06 & 0.03 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=316095&T=2

[TABLE]
[ROW][C]Tabulation of Expected Results[/C][/ROW]
[ROW][C]calories  x  weight[/C][/ROW]
[ROW][C] [/C][C]0.5[/C][C]0.83[/C][C]1[/C][C]1.25[/C][C]1.3[/C][C]1.33[/C][C]1.5[/C][/ROW]
[C]50[/C][C]0.08[/C][C]0.04[/C][C]2.49[/C][C]0.08[/C][C]0.04[/C][C]0.19[/C][C]0.08[/C][/ROW]
[C]70[/C][C]0.05[/C][C]0.03[/C][C]1.66[/C][C]0.05[/C][C]0.03[/C][C]0.13[/C][C]0.05[/C][/ROW]
[C]80[/C][C]0.03[/C][C]0.01[/C][C]0.83[/C][C]0.03[/C][C]0.01[/C][C]0.06[/C][C]0.03[/C][/ROW]
[C]90[/C][C]0.18[/C][C]0.09[/C][C]5.82[/C][C]0.18[/C][C]0.09[/C][C]0.45[/C][C]0.18[/C][/ROW]
[C]100[/C][C]0.44[/C][C]0.22[/C][C]14.13[/C][C]0.44[/C][C]0.22[/C][C]1.1[/C][C]0.44[/C][/ROW]
[C]110[/C][C]0.75[/C][C]0.38[/C][C]24.1[/C][C]0.75[/C][C]0.38[/C][C]1.88[/C][C]0.75[/C][/ROW]
[C]120[/C][C]0.26[/C][C]0.13[/C][C]8.31[/C][C]0.26[/C][C]0.13[/C][C]0.65[/C][C]0.26[/C][/ROW]
[C]130[/C][C]0.05[/C][C]0.03[/C][C]1.66[/C][C]0.05[/C][C]0.03[/C][C]0.13[/C][C]0.05[/C][/ROW]
[C]140[/C][C]0.08[/C][C]0.04[/C][C]2.49[/C][C]0.08[/C][C]0.04[/C][C]0.19[/C][C]0.08[/C][/ROW]
[C]150[/C][C]0.05[/C][C]0.03[/C][C]1.66[/C][C]0.05[/C][C]0.03[/C][C]0.13[/C][C]0.05[/C][/ROW]
[C]160[/C][C]0.03[/C][C]0.01[/C][C]0.83[/C][C]0.03[/C][C]0.01[/C][C]0.06[/C][C]0.03[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=316095&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=316095&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
calories x weight
0.50.8311.251.31.331.5
500.080.042.490.080.040.190.08
700.050.031.660.050.030.130.05
800.030.010.830.030.010.060.03
900.180.095.820.180.090.450.18
1000.440.2214.130.440.221.10.44
1100.750.3824.10.750.381.880.75
1200.260.138.310.260.130.650.26
1300.050.031.660.050.030.130.05
1400.080.042.490.080.040.190.08
1500.050.031.660.050.030.130.05
1600.030.010.830.030.010.060.03







Statistical Results
Pearson's Chi-squared test
Pearson Chi Square Statistic251.44
Degrees of Freedom60
P value0

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

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



Parameters (Session):
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')