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, 14 Dec 2011 04:29:28 -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/Dec/14/t1323854991l93nzr41as040ua.htm/, Retrieved Wed, 01 May 2024 22:32:17 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=154819, Retrieved Wed, 01 May 2024 22:32:17 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact122
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] [Paper Hypothese 3] [2011-12-14 09:29:28] [312c935a345ba403c8b6fcfc5a5ec794] [Current]
-    D    [Chi-Squared Test, McNemar Test, and Fisher Exact Test] [Paper Hypothese 3] [2011-12-14 09:34:38] [a98cda5652e91ff8cb6c2e418e82d3de]
-           [Chi-Squared Test, McNemar Test, and Fisher Exact Test] [Hypothese 3 voor ...] [2011-12-14 09:37:50] [a98cda5652e91ff8cb6c2e418e82d3de]
-    D        [Chi-Squared Test, McNemar Test, and Fisher Exact Test] [Paper Hypothese 3.2] [2011-12-14 09:43:29] [a98cda5652e91ff8cb6c2e418e82d3de]
Feedback Forum

Post a new message
Dataseries X:
12	14
11	18
15	11
6	12
13	16
10	18
12	14
14	14
12	15
6	15
10	17
12	19
12	10
11	16
15	18
12	14
10	14
12	17
11	14
12	16
11	18
12	11
13	14
11	12
9	17
13	9
10	16
14	14
12	15
10	11
12	16
8	13
10	17
12	15
12	14
7	16
6	9
12	15
10	17
10	13
10	15
12	16
15	16
10	12
10	12
12	11
13	15
11	15
11	17
12	13
14	16
10	14
12	11
13	12
5	12
6	15
12	16
12	15
11	12
10	12
7	8
12	13
14	11
11	14
12	15
13	10
14	11
11	12
12	15
12	15
8	14
11	16
14	15
14	15
12	13
9	12
13	17
11	13
12	15
12	13
12	15
12	16
12	15
12	16
11	15
10	14
9	15
12	14
12	13
12	7
9	17
15	13
12	15
12	14
12	13
10	16
13	12
9	14
12	17
10	15
14	17
11	12
15	16
11	11
11	15
12	9
12	16
12	15
11	10
7	10
12	15
14	11
11	13
11	14
10	18
13	16
13	14
8	14
11	14
12	14
11	12
13	14
12	15
14	15
13	15
15	13
10	17
11	17
9	19
11	15
10	13
11	9
8	15
11	15
12	15
12	16
9	11
11	14
10	11
8	15
9	13
8	15
9	16
15	14
11	15
8	16
13	16
12	11
12	12
9	9
7	16
13	13
9	16
6	12
8	9
8	13
15	13
6	14
9	19
11	13
8	12
8	13




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=154819&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'George Udny Yule' @ yule.wessa.net







Tabulation of Results
Software x Happiness
78910111213141516171819
50000010000000
60010020120000
70101000002000
80010013231000
90010111112202
100000232322420
110011153562220
1210114167168201
130011021323100
140000300231100
150000103102010

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

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=154819&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
Software x Happiness
78910111213141516171819
50000010000000
60010020120000
70101000002000
80010013231000
90010111112202
100000232322420
110011153562220
1210114167168201
130011021323100
140000300231100
150000103102010







Tabulation of Expected Results
Software x Happiness
78910111213141516171819
50.010.010.040.020.070.10.120.150.220.140.070.030.02
60.040.040.220.150.440.590.70.931.30.850.440.190.11
70.020.020.150.10.30.40.470.620.860.570.30.120.07
80.070.070.410.270.811.091.291.72.381.560.810.340.2
90.070.070.440.30.891.191.411.852.591.70.890.370.22
100.120.120.740.491.481.982.353.094.322.841.480.620.37
110.170.171.040.692.072.773.284.326.053.982.070.860.52
120.30.31.781.193.564.745.637.4110.376.813.561.480.89
130.090.090.520.351.041.381.642.163.021.991.040.430.26
140.060.060.370.250.740.991.171.542.161.420.740.310.19
150.050.050.30.20.590.790.941.231.731.140.590.250.15

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
Software  x  Happiness \tabularnewline
  & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 \tabularnewline
5 & 0.01 & 0.01 & 0.04 & 0.02 & 0.07 & 0.1 & 0.12 & 0.15 & 0.22 & 0.14 & 0.07 & 0.03 & 0.02 \tabularnewline
6 & 0.04 & 0.04 & 0.22 & 0.15 & 0.44 & 0.59 & 0.7 & 0.93 & 1.3 & 0.85 & 0.44 & 0.19 & 0.11 \tabularnewline
7 & 0.02 & 0.02 & 0.15 & 0.1 & 0.3 & 0.4 & 0.47 & 0.62 & 0.86 & 0.57 & 0.3 & 0.12 & 0.07 \tabularnewline
8 & 0.07 & 0.07 & 0.41 & 0.27 & 0.81 & 1.09 & 1.29 & 1.7 & 2.38 & 1.56 & 0.81 & 0.34 & 0.2 \tabularnewline
9 & 0.07 & 0.07 & 0.44 & 0.3 & 0.89 & 1.19 & 1.41 & 1.85 & 2.59 & 1.7 & 0.89 & 0.37 & 0.22 \tabularnewline
10 & 0.12 & 0.12 & 0.74 & 0.49 & 1.48 & 1.98 & 2.35 & 3.09 & 4.32 & 2.84 & 1.48 & 0.62 & 0.37 \tabularnewline
11 & 0.17 & 0.17 & 1.04 & 0.69 & 2.07 & 2.77 & 3.28 & 4.32 & 6.05 & 3.98 & 2.07 & 0.86 & 0.52 \tabularnewline
12 & 0.3 & 0.3 & 1.78 & 1.19 & 3.56 & 4.74 & 5.63 & 7.41 & 10.37 & 6.81 & 3.56 & 1.48 & 0.89 \tabularnewline
13 & 0.09 & 0.09 & 0.52 & 0.35 & 1.04 & 1.38 & 1.64 & 2.16 & 3.02 & 1.99 & 1.04 & 0.43 & 0.26 \tabularnewline
14 & 0.06 & 0.06 & 0.37 & 0.25 & 0.74 & 0.99 & 1.17 & 1.54 & 2.16 & 1.42 & 0.74 & 0.31 & 0.19 \tabularnewline
15 & 0.05 & 0.05 & 0.3 & 0.2 & 0.59 & 0.79 & 0.94 & 1.23 & 1.73 & 1.14 & 0.59 & 0.25 & 0.15 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=154819&T=2

[TABLE]
[ROW][C]Tabulation of Expected Results[/C][/ROW]
[ROW][C]Software  x  Happiness[/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][/ROW]
[C]5[/C][C]0.01[/C][C]0.01[/C][C]0.04[/C][C]0.02[/C][C]0.07[/C][C]0.1[/C][C]0.12[/C][C]0.15[/C][C]0.22[/C][C]0.14[/C][C]0.07[/C][C]0.03[/C][C]0.02[/C][/ROW]
[C]6[/C][C]0.04[/C][C]0.04[/C][C]0.22[/C][C]0.15[/C][C]0.44[/C][C]0.59[/C][C]0.7[/C][C]0.93[/C][C]1.3[/C][C]0.85[/C][C]0.44[/C][C]0.19[/C][C]0.11[/C][/ROW]
[C]7[/C][C]0.02[/C][C]0.02[/C][C]0.15[/C][C]0.1[/C][C]0.3[/C][C]0.4[/C][C]0.47[/C][C]0.62[/C][C]0.86[/C][C]0.57[/C][C]0.3[/C][C]0.12[/C][C]0.07[/C][/ROW]
[C]8[/C][C]0.07[/C][C]0.07[/C][C]0.41[/C][C]0.27[/C][C]0.81[/C][C]1.09[/C][C]1.29[/C][C]1.7[/C][C]2.38[/C][C]1.56[/C][C]0.81[/C][C]0.34[/C][C]0.2[/C][/ROW]
[C]9[/C][C]0.07[/C][C]0.07[/C][C]0.44[/C][C]0.3[/C][C]0.89[/C][C]1.19[/C][C]1.41[/C][C]1.85[/C][C]2.59[/C][C]1.7[/C][C]0.89[/C][C]0.37[/C][C]0.22[/C][/ROW]
[C]10[/C][C]0.12[/C][C]0.12[/C][C]0.74[/C][C]0.49[/C][C]1.48[/C][C]1.98[/C][C]2.35[/C][C]3.09[/C][C]4.32[/C][C]2.84[/C][C]1.48[/C][C]0.62[/C][C]0.37[/C][/ROW]
[C]11[/C][C]0.17[/C][C]0.17[/C][C]1.04[/C][C]0.69[/C][C]2.07[/C][C]2.77[/C][C]3.28[/C][C]4.32[/C][C]6.05[/C][C]3.98[/C][C]2.07[/C][C]0.86[/C][C]0.52[/C][/ROW]
[C]12[/C][C]0.3[/C][C]0.3[/C][C]1.78[/C][C]1.19[/C][C]3.56[/C][C]4.74[/C][C]5.63[/C][C]7.41[/C][C]10.37[/C][C]6.81[/C][C]3.56[/C][C]1.48[/C][C]0.89[/C][/ROW]
[C]13[/C][C]0.09[/C][C]0.09[/C][C]0.52[/C][C]0.35[/C][C]1.04[/C][C]1.38[/C][C]1.64[/C][C]2.16[/C][C]3.02[/C][C]1.99[/C][C]1.04[/C][C]0.43[/C][C]0.26[/C][/ROW]
[C]14[/C][C]0.06[/C][C]0.06[/C][C]0.37[/C][C]0.25[/C][C]0.74[/C][C]0.99[/C][C]1.17[/C][C]1.54[/C][C]2.16[/C][C]1.42[/C][C]0.74[/C][C]0.31[/C][C]0.19[/C][/ROW]
[C]15[/C][C]0.05[/C][C]0.05[/C][C]0.3[/C][C]0.2[/C][C]0.59[/C][C]0.79[/C][C]0.94[/C][C]1.23[/C][C]1.73[/C][C]1.14[/C][C]0.59[/C][C]0.25[/C][C]0.15[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=154819&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=154819&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
Software x Happiness
78910111213141516171819
50.010.010.040.020.070.10.120.150.220.140.070.030.02
60.040.040.220.150.440.590.70.931.30.850.440.190.11
70.020.020.150.10.30.40.470.620.860.570.30.120.07
80.070.070.410.270.811.091.291.72.381.560.810.340.2
90.070.070.440.30.891.191.411.852.591.70.890.370.22
100.120.120.740.491.481.982.353.094.322.841.480.620.37
110.170.171.040.692.072.773.284.326.053.982.070.860.52
120.30.31.781.193.564.745.637.4110.376.813.561.480.89
130.090.090.520.351.041.381.642.163.021.991.040.430.26
140.060.060.370.250.740.991.171.542.161.420.740.310.19
150.050.050.30.20.590.790.941.231.731.140.590.250.15







Statistical Results
Pearson's Chi-squared test
Pearson Chi Square Statistic153.27
Degrees of Freedom120
P value0.02

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=154819&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 Statistic153.27
Degrees of Freedom120
P value0.02



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