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 08:35:07 -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/t1321450531zk4f3s8jg03q9si.htm/, Retrieved Wed, 24 Apr 2024 11:20:29 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=143889, Retrieved Wed, 24 Apr 2024 11:20:29 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact82
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] [chikwadraat WS6] [2011-11-16 13:35:07] [be4736a77bd16673cc7d722e93d61b0f] [Current]
Feedback Forum

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




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

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







Tabulation of Results
Connected x Separate
282930313233343536373839
27000010000000
29000200100000
30100000010000
31100101000000
32001024000010
33000001100200
34001002001210
35010002100000
36000011120010
37000120011011
38100120110011
39000120100030
41000010000010

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
Connected  x  Separate \tabularnewline
  & 28 & 29 & 30 & 31 & 32 & 33 & 34 & 35 & 36 & 37 & 38 & 39 \tabularnewline
27 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
29 & 0 & 0 & 0 & 2 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \tabularnewline
30 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \tabularnewline
31 & 1 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline
32 & 0 & 0 & 1 & 0 & 2 & 4 & 0 & 0 & 0 & 0 & 1 & 0 \tabularnewline
33 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 2 & 0 & 0 \tabularnewline
34 & 0 & 0 & 1 & 0 & 0 & 2 & 0 & 0 & 1 & 2 & 1 & 0 \tabularnewline
35 & 0 & 1 & 0 & 0 & 0 & 2 & 1 & 0 & 0 & 0 & 0 & 0 \tabularnewline
36 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 2 & 0 & 0 & 1 & 0 \tabularnewline
37 & 0 & 0 & 0 & 1 & 2 & 0 & 0 & 1 & 1 & 0 & 1 & 1 \tabularnewline
38 & 1 & 0 & 0 & 1 & 2 & 0 & 1 & 1 & 0 & 0 & 1 & 1 \tabularnewline
39 & 0 & 0 & 0 & 1 & 2 & 0 & 1 & 0 & 0 & 0 & 3 & 0 \tabularnewline
41 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=143889&T=1

[TABLE]
[ROW][C]Tabulation of Results[/C][/ROW]
[ROW][C]Connected  x  Separate[/C][/ROW]
[ROW][C] [/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][/ROW]
[C]27[/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][C]0[/C][/ROW]
[C]29[/C][C]0[/C][C]0[/C][C]0[/C][C]2[/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][/ROW]
[C]30[/C][C]1[/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]
[C]31[/C][C]1[/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]32[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]2[/C][C]4[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[C]33[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][C]0[/C][C]0[/C][C]2[/C][C]0[/C][C]0[/C][/ROW]
[C]34[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]2[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]1[/C][C]0[/C][/ROW]
[C]35[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]2[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]36[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][C]1[/C][C]2[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[C]37[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[C]38[/C][C]1[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]0[/C][C]1[/C][C]1[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[C]39[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]3[/C][C]0[/C][/ROW]
[C]41[/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]1[/C][C]0[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=143889&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=143889&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
Connected x Separate
282930313233343536373839
27000010000000
29000200100000
30100000010000
31100101000000
32001024000010
33000001100200
34001002001210
35010002100000
36000011120010
37000120011011
38100120110011
39000120100030
41000010000010







Tabulation of Expected Results
Connected x Separate
282930313233343536373839
270.050.020.030.10.180.180.10.080.030.060.150.03
290.150.050.10.290.530.530.290.240.10.190.440.1
300.10.030.060.190.350.350.190.160.060.130.290.06
310.150.050.10.290.530.530.290.240.10.190.440.1
320.390.130.260.771.421.420.770.650.260.521.160.26
330.190.060.130.390.710.710.390.320.130.260.580.13
340.340.110.230.681.241.240.680.560.230.451.020.23
350.190.060.130.390.710.710.390.320.130.260.580.13
360.290.10.190.581.061.060.580.480.190.390.870.19
370.340.110.230.681.241.240.680.560.230.451.020.23
380.390.130.260.771.421.420.770.650.260.521.160.26
390.340.110.230.681.241.240.680.560.230.451.020.23
410.10.030.060.190.350.350.190.160.060.130.290.06

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
Connected  x  Separate \tabularnewline
  & 28 & 29 & 30 & 31 & 32 & 33 & 34 & 35 & 36 & 37 & 38 & 39 \tabularnewline
27 & 0.05 & 0.02 & 0.03 & 0.1 & 0.18 & 0.18 & 0.1 & 0.08 & 0.03 & 0.06 & 0.15 & 0.03 \tabularnewline
29 & 0.15 & 0.05 & 0.1 & 0.29 & 0.53 & 0.53 & 0.29 & 0.24 & 0.1 & 0.19 & 0.44 & 0.1 \tabularnewline
30 & 0.1 & 0.03 & 0.06 & 0.19 & 0.35 & 0.35 & 0.19 & 0.16 & 0.06 & 0.13 & 0.29 & 0.06 \tabularnewline
31 & 0.15 & 0.05 & 0.1 & 0.29 & 0.53 & 0.53 & 0.29 & 0.24 & 0.1 & 0.19 & 0.44 & 0.1 \tabularnewline
32 & 0.39 & 0.13 & 0.26 & 0.77 & 1.42 & 1.42 & 0.77 & 0.65 & 0.26 & 0.52 & 1.16 & 0.26 \tabularnewline
33 & 0.19 & 0.06 & 0.13 & 0.39 & 0.71 & 0.71 & 0.39 & 0.32 & 0.13 & 0.26 & 0.58 & 0.13 \tabularnewline
34 & 0.34 & 0.11 & 0.23 & 0.68 & 1.24 & 1.24 & 0.68 & 0.56 & 0.23 & 0.45 & 1.02 & 0.23 \tabularnewline
35 & 0.19 & 0.06 & 0.13 & 0.39 & 0.71 & 0.71 & 0.39 & 0.32 & 0.13 & 0.26 & 0.58 & 0.13 \tabularnewline
36 & 0.29 & 0.1 & 0.19 & 0.58 & 1.06 & 1.06 & 0.58 & 0.48 & 0.19 & 0.39 & 0.87 & 0.19 \tabularnewline
37 & 0.34 & 0.11 & 0.23 & 0.68 & 1.24 & 1.24 & 0.68 & 0.56 & 0.23 & 0.45 & 1.02 & 0.23 \tabularnewline
38 & 0.39 & 0.13 & 0.26 & 0.77 & 1.42 & 1.42 & 0.77 & 0.65 & 0.26 & 0.52 & 1.16 & 0.26 \tabularnewline
39 & 0.34 & 0.11 & 0.23 & 0.68 & 1.24 & 1.24 & 0.68 & 0.56 & 0.23 & 0.45 & 1.02 & 0.23 \tabularnewline
41 & 0.1 & 0.03 & 0.06 & 0.19 & 0.35 & 0.35 & 0.19 & 0.16 & 0.06 & 0.13 & 0.29 & 0.06 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=143889&T=2

[TABLE]
[ROW][C]Tabulation of Expected Results[/C][/ROW]
[ROW][C]Connected  x  Separate[/C][/ROW]
[ROW][C] [/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][/ROW]
[C]27[/C][C]0.05[/C][C]0.02[/C][C]0.03[/C][C]0.1[/C][C]0.18[/C][C]0.18[/C][C]0.1[/C][C]0.08[/C][C]0.03[/C][C]0.06[/C][C]0.15[/C][C]0.03[/C][/ROW]
[C]29[/C][C]0.15[/C][C]0.05[/C][C]0.1[/C][C]0.29[/C][C]0.53[/C][C]0.53[/C][C]0.29[/C][C]0.24[/C][C]0.1[/C][C]0.19[/C][C]0.44[/C][C]0.1[/C][/ROW]
[C]30[/C][C]0.1[/C][C]0.03[/C][C]0.06[/C][C]0.19[/C][C]0.35[/C][C]0.35[/C][C]0.19[/C][C]0.16[/C][C]0.06[/C][C]0.13[/C][C]0.29[/C][C]0.06[/C][/ROW]
[C]31[/C][C]0.15[/C][C]0.05[/C][C]0.1[/C][C]0.29[/C][C]0.53[/C][C]0.53[/C][C]0.29[/C][C]0.24[/C][C]0.1[/C][C]0.19[/C][C]0.44[/C][C]0.1[/C][/ROW]
[C]32[/C][C]0.39[/C][C]0.13[/C][C]0.26[/C][C]0.77[/C][C]1.42[/C][C]1.42[/C][C]0.77[/C][C]0.65[/C][C]0.26[/C][C]0.52[/C][C]1.16[/C][C]0.26[/C][/ROW]
[C]33[/C][C]0.19[/C][C]0.06[/C][C]0.13[/C][C]0.39[/C][C]0.71[/C][C]0.71[/C][C]0.39[/C][C]0.32[/C][C]0.13[/C][C]0.26[/C][C]0.58[/C][C]0.13[/C][/ROW]
[C]34[/C][C]0.34[/C][C]0.11[/C][C]0.23[/C][C]0.68[/C][C]1.24[/C][C]1.24[/C][C]0.68[/C][C]0.56[/C][C]0.23[/C][C]0.45[/C][C]1.02[/C][C]0.23[/C][/ROW]
[C]35[/C][C]0.19[/C][C]0.06[/C][C]0.13[/C][C]0.39[/C][C]0.71[/C][C]0.71[/C][C]0.39[/C][C]0.32[/C][C]0.13[/C][C]0.26[/C][C]0.58[/C][C]0.13[/C][/ROW]
[C]36[/C][C]0.29[/C][C]0.1[/C][C]0.19[/C][C]0.58[/C][C]1.06[/C][C]1.06[/C][C]0.58[/C][C]0.48[/C][C]0.19[/C][C]0.39[/C][C]0.87[/C][C]0.19[/C][/ROW]
[C]37[/C][C]0.34[/C][C]0.11[/C][C]0.23[/C][C]0.68[/C][C]1.24[/C][C]1.24[/C][C]0.68[/C][C]0.56[/C][C]0.23[/C][C]0.45[/C][C]1.02[/C][C]0.23[/C][/ROW]
[C]38[/C][C]0.39[/C][C]0.13[/C][C]0.26[/C][C]0.77[/C][C]1.42[/C][C]1.42[/C][C]0.77[/C][C]0.65[/C][C]0.26[/C][C]0.52[/C][C]1.16[/C][C]0.26[/C][/ROW]
[C]39[/C][C]0.34[/C][C]0.11[/C][C]0.23[/C][C]0.68[/C][C]1.24[/C][C]1.24[/C][C]0.68[/C][C]0.56[/C][C]0.23[/C][C]0.45[/C][C]1.02[/C][C]0.23[/C][/ROW]
[C]41[/C][C]0.1[/C][C]0.03[/C][C]0.06[/C][C]0.19[/C][C]0.35[/C][C]0.35[/C][C]0.19[/C][C]0.16[/C][C]0.06[/C][C]0.13[/C][C]0.29[/C][C]0.06[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=143889&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=143889&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
Connected x Separate
282930313233343536373839
270.050.020.030.10.180.180.10.080.030.060.150.03
290.150.050.10.290.530.530.290.240.10.190.440.1
300.10.030.060.190.350.350.190.160.060.130.290.06
310.150.050.10.290.530.530.290.240.10.190.440.1
320.390.130.260.771.421.420.770.650.260.521.160.26
330.190.060.130.390.710.710.390.320.130.260.580.13
340.340.110.230.681.241.240.680.560.230.451.020.23
350.190.060.130.390.710.710.390.320.130.260.580.13
360.290.10.190.581.061.060.580.480.190.390.870.19
370.340.110.230.681.241.240.680.560.230.451.020.23
380.390.130.260.771.421.420.770.650.260.521.160.26
390.340.110.230.681.241.240.680.560.230.451.020.23
410.10.030.060.190.350.350.190.160.060.130.290.06







Statistical Results
Pearson's Chi-squared test
Pearson Chi Square Statistic138.45
Degrees of Freedom132
P value0.33

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=143889&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 Statistic138.45
Degrees of Freedom132
P value0.33



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