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, 10 Dec 2014 17:58:58 +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/2014/Dec/10/t14182343641xwpvl957qncgth.htm/, Retrieved Wed, 29 May 2024 02:31:24 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=265545, Retrieved Wed, 29 May 2024 02:31:24 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact50
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 KWADRAAT ] [2014-12-10 17:58:58] [e4bec374a19c70fe4499af2adad38eb7] [Current]
Feedback Forum

Post a new message
Dataseries X:
13 13 12 26 NA 50 NA
11 8 8 NA 57 NA 62
13 14 11 37 NA 54 NA
12 16 13 NA 67 NA 71
13 14 11 NA 43 NA 54
12 13 10 NA 52 NA 65
15 15 7 52 NA 73 NA
11 13 10 NA 43 NA 52
12 20 15 NA 84 NA 84
12 17 12 NA 67 NA 42
12 15 12 NA 49 NA 66
13 16 10 NA 70 NA 65
13 12 10 NA 52 NA 78
11 17 14 58 NA 73 NA
12 11 6 68 NA 75 NA
13 16 12 62 NA 72 NA
10 16 14 NA 43 NA 66
12 15 11 56 NA 70 NA
13 13 8 NA 56 NA 61
12 14 12 74 NA 81 NA
11 19 15 NA 65 NA 71
11 16 13 NA 63 NA 69
14 17 11 58 NA 71 NA
12 10 12 NA 57 NA 72
14 15 7 NA 63 NA 68
12 14 11 NA 53 NA 70
12 14 7 NA 57 NA 68
13 16 12 51 NA 61 NA
12 15 12 NA 64 NA 67
16 17 13 53 NA 76 NA
12 14 9 29 NA 70 NA
12 16 11 54 NA 60 NA
12 15 12 NA 58 NA 72
16 16 15 NA 43 NA 69
13 16 12 NA 51 NA 71
10 10 6 NA 53 NA 62
14 8 5 54 NA 70 NA
13 17 13 NA 56 NA 64
12 14 11 NA 61 NA 58
16 10 6 47 NA 76 NA
12 14 12 NA 39 NA 52
12 12 10 NA 48 NA 59
13 16 6 NA 50 NA 68
13 16 12 NA 35 NA 76
16 16 11 NA 30 NA 65
16 8 6 68 NA 67 NA
14 16 12 NA 49 NA 59
14 15 12 NA 61 NA 69
14 8 8 67 NA 76 NA
10 13 10 NA 47 NA 63
13 14 11 NA 56 NA 75
14 13 7 NA 50 NA 63
17 16 12 NA 43 NA 60
12 19 13 NA 67 NA 73
12 19 14 NA 62 NA 63
10 14 12 NA 57 NA 70
13 15 6 41 NA 75 NA
12 13 14 NA 54 NA 66
14 10 10 45 NA 63 NA
13 16 12 NA 48 NA 63
14 15 11 NA 61 NA 64
10 11 10 56 NA 70 NA
12 9 7 41 NA 75 NA
13 16 12 NA 43 NA 61
13 12 7 53 NA 60 NA
10 12 12 NA 44 NA 62
13 14 12 66 NA 73 NA
13 14 10 NA 58 NA 61
12 13 10 NA 46 NA 66
12 15 12 37 NA 64 NA
15 17 12 51 NA 59 NA
12 14 12 51 NA 64 NA
15 11 8 56 NA 60 NA
10 9 10 NA 66 NA 56
13 7 5 37 NA 78 NA
10 15 10 42 NA 67 NA
12 12 12 NA 38 NA 59
14 15 11 66 NA 66 NA
12 14 9 34 NA 68 NA
11 16 12 NA 53 NA 71
9 14 11 49 NA 66 NA
13 13 10 55 NA 73 NA
12 16 12 49 NA 72 NA
12 13 10 NA 59 NA 71
11 16 9 40 NA 59 NA
14 16 11 NA 58 NA 64
12 16 12 NA 60 NA 66
13 10 7 63 NA 78 NA
9 12 11 56 NA 68 NA
13 12 12 54 NA 73 NA
11 12 6 NA 52 NA 62
12 12 9 NA 34 NA 65
13 19 15 NA 69 NA 68
12 14 10 32 NA 65 NA
12 13 11 NA 48 NA 60
12 16 12 67 NA 71 NA
12 15 12 NA 58 NA 65
13 12 12 NA 57 NA 68
14 8 11 NA 42 NA 64
13 10 9 NA 64 NA 74
12 16 11 NA 58 NA 69
13 16 12 66 NA 76 NA
14 10 12 NA 26 NA 68
12 18 14 NA 61 NA 72
11 12 8 NA 52 NA 67
12 16 10 51 NA 63 NA
11 10 9 55 NA 59 NA
14 14 10 50 NA 73 NA
13 12 9 60 NA 66 NA
11 11 10 56 NA 62 NA
16 15 12 63 NA 69 NA
13 7 11 NA 61 NA 66




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gertrude Mary Cox' @ cox.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 & 2 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=265545&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=265545&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=265545&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 time2 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net







Tabulation of Results
stress_tot x CONFSTATTOT
7891011121314151617181920
900000101000000
1000111111110000
1101011210031010
1200111359671121
1320020535191010
1403020011421000
1500001000101000
1601010000121000
1700000000010000

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline stress_tot x CONFSTATTOT \tabularnewline & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 \tabularnewline 9 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline 10 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \tabularnewline 11 & 0 & 1 & 0 & 1 & 1 & 2 & 1 & 0 & 0 & 3 & 1 & 0 & 1 & 0 \tabularnewline 12 & 0 & 0 & 1 & 1 & 1 & 3 & 5 & 9 & 6 & 7 & 1 & 1 & 2 & 1 \tabularnewline 13 & 2 & 0 & 0 & 2 & 0 & 5 & 3 & 5 & 1 & 9 & 1 & 0 & 1 & 0 \tabularnewline 14 & 0 & 3 & 0 & 2 & 0 & 0 & 1 & 1 & 4 & 2 & 1 & 0 & 0 & 0 \tabularnewline 15 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 \tabularnewline 16 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 2 & 1 & 0 & 0 & 0 \tabularnewline 17 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=265545&T=1

[TABLE]
[ROW]
Tabulation of Results[/C][/ROW] [ROW]stress_tot x CONFSTATTOT[/C][/ROW] [ROW][C] [/C][C]7[/C][C]8[/C][C]9[/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]9[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/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]10[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][C]1[/C][C]1[/C][C]1[/C][C]1[/C][C]1[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [C]11[/C][C]0[/C][C]1[/C][C]0[/C][C]1[/C][C]1[/C][C]2[/C][C]1[/C][C]0[/C][C]0[/C][C]3[/C][C]1[/C][C]0[/C][C]1[/C][C]0[/C][/ROW] [C]12[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][C]1[/C][C]3[/C][C]5[/C][C]9[/C][C]6[/C][C]7[/C][C]1[/C][C]1[/C][C]2[/C][C]1[/C][/ROW] [C]13[/C][C]2[/C][C]0[/C][C]0[/C][C]2[/C][C]0[/C][C]5[/C][C]3[/C][C]5[/C][C]1[/C][C]9[/C][C]1[/C][C]0[/C][C]1[/C][C]0[/C][/ROW] [C]14[/C][C]0[/C][C]3[/C][C]0[/C][C]2[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][C]4[/C][C]2[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [C]15[/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]1[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [C]16[/C][C]0[/C][C]1[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [C]17[/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][C]0[/C][C]0[/C][C]0[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=265545&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=265545&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
stress_tot x CONFSTATTOT
7891011121314151617181920
900000101000000
1000111111110000
1101011210031010
1200111359671121
1320020535191010
1403020011421000
1500001000101000
1601010000121000
1700000000010000







Tabulation of Expected Results
stress_tot x CONFSTATTOT
7891011121314151617181920
90.040.090.040.140.070.210.20.30.250.450.110.020.070.02
100.140.360.140.570.290.860.791.2111.790.430.070.290.07
110.20.490.20.790.391.181.081.671.382.460.590.10.390.1
120.681.70.682.711.364.073.735.774.758.482.040.341.360.34
130.521.290.522.071.043.112.854.43.626.471.550.261.040.26
140.250.620.2510.51.51.382.121.753.120.750.120.50.12
150.050.130.050.210.110.320.290.460.380.670.160.030.110.03
160.110.270.110.430.210.640.590.910.751.340.320.050.210.05
170.020.040.020.070.040.110.10.150.120.220.050.010.040.01

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline stress_tot x CONFSTATTOT \tabularnewline & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 \tabularnewline 9 & 0.04 & 0.09 & 0.04 & 0.14 & 0.07 & 0.21 & 0.2 & 0.3 & 0.25 & 0.45 & 0.11 & 0.02 & 0.07 & 0.02 \tabularnewline 10 & 0.14 & 0.36 & 0.14 & 0.57 & 0.29 & 0.86 & 0.79 & 1.21 & 1 & 1.79 & 0.43 & 0.07 & 0.29 & 0.07 \tabularnewline 11 & 0.2 & 0.49 & 0.2 & 0.79 & 0.39 & 1.18 & 1.08 & 1.67 & 1.38 & 2.46 & 0.59 & 0.1 & 0.39 & 0.1 \tabularnewline 12 & 0.68 & 1.7 & 0.68 & 2.71 & 1.36 & 4.07 & 3.73 & 5.77 & 4.75 & 8.48 & 2.04 & 0.34 & 1.36 & 0.34 \tabularnewline 13 & 0.52 & 1.29 & 0.52 & 2.07 & 1.04 & 3.11 & 2.85 & 4.4 & 3.62 & 6.47 & 1.55 & 0.26 & 1.04 & 0.26 \tabularnewline 14 & 0.25 & 0.62 & 0.25 & 1 & 0.5 & 1.5 & 1.38 & 2.12 & 1.75 & 3.12 & 0.75 & 0.12 & 0.5 & 0.12 \tabularnewline 15 & 0.05 & 0.13 & 0.05 & 0.21 & 0.11 & 0.32 & 0.29 & 0.46 & 0.38 & 0.67 & 0.16 & 0.03 & 0.11 & 0.03 \tabularnewline 16 & 0.11 & 0.27 & 0.11 & 0.43 & 0.21 & 0.64 & 0.59 & 0.91 & 0.75 & 1.34 & 0.32 & 0.05 & 0.21 & 0.05 \tabularnewline 17 & 0.02 & 0.04 & 0.02 & 0.07 & 0.04 & 0.11 & 0.1 & 0.15 & 0.12 & 0.22 & 0.05 & 0.01 & 0.04 & 0.01 \tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=265545&T=2

[TABLE]
[ROW]
Tabulation of Expected Results[/C][/ROW] [ROW]stress_tot x CONFSTATTOT[/C][/ROW] [ROW][C] [/C][C]7[/C][C]8[/C][C]9[/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]9[/C][C]0.04[/C][C]0.09[/C][C]0.04[/C][C]0.14[/C][C]0.07[/C][C]0.21[/C][C]0.2[/C][C]0.3[/C][C]0.25[/C][C]0.45[/C][C]0.11[/C][C]0.02[/C][C]0.07[/C][C]0.02[/C][/ROW] [C]10[/C][C]0.14[/C][C]0.36[/C][C]0.14[/C][C]0.57[/C][C]0.29[/C][C]0.86[/C][C]0.79[/C][C]1.21[/C][C]1[/C][C]1.79[/C][C]0.43[/C][C]0.07[/C][C]0.29[/C][C]0.07[/C][/ROW] [C]11[/C][C]0.2[/C][C]0.49[/C][C]0.2[/C][C]0.79[/C][C]0.39[/C][C]1.18[/C][C]1.08[/C][C]1.67[/C][C]1.38[/C][C]2.46[/C][C]0.59[/C][C]0.1[/C][C]0.39[/C][C]0.1[/C][/ROW] [C]12[/C][C]0.68[/C][C]1.7[/C][C]0.68[/C][C]2.71[/C][C]1.36[/C][C]4.07[/C][C]3.73[/C][C]5.77[/C][C]4.75[/C][C]8.48[/C][C]2.04[/C][C]0.34[/C][C]1.36[/C][C]0.34[/C][/ROW] [C]13[/C][C]0.52[/C][C]1.29[/C][C]0.52[/C][C]2.07[/C][C]1.04[/C][C]3.11[/C][C]2.85[/C][C]4.4[/C][C]3.62[/C][C]6.47[/C][C]1.55[/C][C]0.26[/C][C]1.04[/C][C]0.26[/C][/ROW] [C]14[/C][C]0.25[/C][C]0.62[/C][C]0.25[/C][C]1[/C][C]0.5[/C][C]1.5[/C][C]1.38[/C][C]2.12[/C][C]1.75[/C][C]3.12[/C][C]0.75[/C][C]0.12[/C][C]0.5[/C][C]0.12[/C][/ROW] [C]15[/C][C]0.05[/C][C]0.13[/C][C]0.05[/C][C]0.21[/C][C]0.11[/C][C]0.32[/C][C]0.29[/C][C]0.46[/C][C]0.38[/C][C]0.67[/C][C]0.16[/C][C]0.03[/C][C]0.11[/C][C]0.03[/C][/ROW] [C]16[/C][C]0.11[/C][C]0.27[/C][C]0.11[/C][C]0.43[/C][C]0.21[/C][C]0.64[/C][C]0.59[/C][C]0.91[/C][C]0.75[/C][C]1.34[/C][C]0.32[/C][C]0.05[/C][C]0.21[/C][C]0.05[/C][/ROW] [C]17[/C][C]0.02[/C][C]0.04[/C][C]0.02[/C][C]0.07[/C][C]0.04[/C][C]0.11[/C][C]0.1[/C][C]0.15[/C][C]0.12[/C][C]0.22[/C][C]0.05[/C][C]0.01[/C][C]0.04[/C][C]0.01[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=265545&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=265545&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
stress_tot x CONFSTATTOT
7891011121314151617181920
90.040.090.040.140.070.210.20.30.250.450.110.020.070.02
100.140.360.140.570.290.860.791.2111.790.430.070.290.07
110.20.490.20.790.391.181.081.671.382.460.590.10.390.1
120.681.70.682.711.364.073.735.774.758.482.040.341.360.34
130.521.290.522.071.043.112.854.43.626.471.550.261.040.26
140.250.620.2510.51.51.382.121.753.120.750.120.50.12
150.050.130.050.210.110.320.290.460.380.670.160.030.110.03
160.110.270.110.430.210.640.590.910.751.340.320.050.210.05
170.020.040.020.070.040.110.10.150.120.220.050.010.040.01







Statistical Results
Pearson's Chi-squared test
Pearson Chi Square Statistic87.83
Degrees of Freedom104
P value0.87

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=265545&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 Statistic87.83
Degrees of Freedom104
P value0.87



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