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, 01 Feb 2018 11:01:20 +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/Feb/01/t15174793049txk1wopurgnh1v.htm/, Retrieved Sun, 28 Apr 2024 22:37:25 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=314393, Retrieved Sun, 28 Apr 2024 22:37:25 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact49
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-02-01 10:01:20] [2c7049bbcc29bc93573a73f5c62450a0] [Current]
Feedback Forum

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




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

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







Tabulation of Results
Perceived_Usefulness x Perceived_Ease_of_Use
567891011121314151617181920
30100000000000000
60001322002010000
70000041000000000
81010002221000000
90010103557931100
100100212128421000
110000015547421000
12000001144510111020
130000000001211110
140000000001111120
150000000000101234

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

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314393&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
Perceived_Usefulness x Perceived_Ease_of_Use
567891011121314151617181920
30100000000000000
60001322002010000
70000041000000000
81010002221000000
90010103557931100
100100212128421000
110000015547421000
12000001144510111020
130000000001211110
140000000001111120
150000000000101234







Tabulation of Expected Results
Perceived_Usefulness x Perceived_Ease_of_Use
567891011121314151617181920
30.010.010.010.010.030.050.090.090.090.180.170.120.040.030.040.02
60.060.120.120.060.370.550.981.041.041.971.911.290.430.310.490.25
70.030.060.060.030.170.250.450.470.470.890.870.590.20.140.220.11
80.050.10.10.050.30.450.80.850.851.611.561.060.350.250.40.2
90.20.40.40.21.211.813.223.423.426.446.234.221.411.011.610.8
100.130.270.270.130.81.212.152.282.284.294.162.820.940.671.070.54
110.160.320.320.160.971.462.592.752.755.185.023.41.130.811.30.65
120.220.440.440.221.311.963.493.73.76.976.754.581.531.091.740.87
130.040.080.080.040.230.350.630.660.661.251.210.820.270.20.310.16
140.040.080.080.040.230.350.630.660.661.251.210.820.270.20.310.16
150.060.120.120.060.370.550.981.041.041.971.911.290.430.310.490.25

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline Perceived_Usefulness x Perceived_Ease_of_Use \tabularnewline & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 \tabularnewline 3 & 0.01 & 0.01 & 0.01 & 0.01 & 0.03 & 0.05 & 0.09 & 0.09 & 0.09 & 0.18 & 0.17 & 0.12 & 0.04 & 0.03 & 0.04 & 0.02 \tabularnewline 6 & 0.06 & 0.12 & 0.12 & 0.06 & 0.37 & 0.55 & 0.98 & 1.04 & 1.04 & 1.97 & 1.91 & 1.29 & 0.43 & 0.31 & 0.49 & 0.25 \tabularnewline 7 & 0.03 & 0.06 & 0.06 & 0.03 & 0.17 & 0.25 & 0.45 & 0.47 & 0.47 & 0.89 & 0.87 & 0.59 & 0.2 & 0.14 & 0.22 & 0.11 \tabularnewline 8 & 0.05 & 0.1 & 0.1 & 0.05 & 0.3 & 0.45 & 0.8 & 0.85 & 0.85 & 1.61 & 1.56 & 1.06 & 0.35 & 0.25 & 0.4 & 0.2 \tabularnewline 9 & 0.2 & 0.4 & 0.4 & 0.2 & 1.21 & 1.81 & 3.22 & 3.42 & 3.42 & 6.44 & 6.23 & 4.22 & 1.41 & 1.01 & 1.61 & 0.8 \tabularnewline 10 & 0.13 & 0.27 & 0.27 & 0.13 & 0.8 & 1.21 & 2.15 & 2.28 & 2.28 & 4.29 & 4.16 & 2.82 & 0.94 & 0.67 & 1.07 & 0.54 \tabularnewline 11 & 0.16 & 0.32 & 0.32 & 0.16 & 0.97 & 1.46 & 2.59 & 2.75 & 2.75 & 5.18 & 5.02 & 3.4 & 1.13 & 0.81 & 1.3 & 0.65 \tabularnewline 12 & 0.22 & 0.44 & 0.44 & 0.22 & 1.31 & 1.96 & 3.49 & 3.7 & 3.7 & 6.97 & 6.75 & 4.58 & 1.53 & 1.09 & 1.74 & 0.87 \tabularnewline 13 & 0.04 & 0.08 & 0.08 & 0.04 & 0.23 & 0.35 & 0.63 & 0.66 & 0.66 & 1.25 & 1.21 & 0.82 & 0.27 & 0.2 & 0.31 & 0.16 \tabularnewline 14 & 0.04 & 0.08 & 0.08 & 0.04 & 0.23 & 0.35 & 0.63 & 0.66 & 0.66 & 1.25 & 1.21 & 0.82 & 0.27 & 0.2 & 0.31 & 0.16 \tabularnewline 15 & 0.06 & 0.12 & 0.12 & 0.06 & 0.37 & 0.55 & 0.98 & 1.04 & 1.04 & 1.97 & 1.91 & 1.29 & 0.43 & 0.31 & 0.49 & 0.25 \tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=314393&T=2

[TABLE]
[ROW]
Tabulation of Expected Results[/C][/ROW] [ROW]Perceived_Usefulness x Perceived_Ease_of_Use[/C][/ROW] [ROW][C] [/C][C]5[/C][C]6[/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]3[/C][C]0.01[/C][C]0.01[/C][C]0.01[/C][C]0.01[/C][C]0.03[/C][C]0.05[/C][C]0.09[/C][C]0.09[/C][C]0.09[/C][C]0.18[/C][C]0.17[/C][C]0.12[/C][C]0.04[/C][C]0.03[/C][C]0.04[/C][C]0.02[/C][/ROW] [C]6[/C][C]0.06[/C][C]0.12[/C][C]0.12[/C][C]0.06[/C][C]0.37[/C][C]0.55[/C][C]0.98[/C][C]1.04[/C][C]1.04[/C][C]1.97[/C][C]1.91[/C][C]1.29[/C][C]0.43[/C][C]0.31[/C][C]0.49[/C][C]0.25[/C][/ROW] [C]7[/C][C]0.03[/C][C]0.06[/C][C]0.06[/C][C]0.03[/C][C]0.17[/C][C]0.25[/C][C]0.45[/C][C]0.47[/C][C]0.47[/C][C]0.89[/C][C]0.87[/C][C]0.59[/C][C]0.2[/C][C]0.14[/C][C]0.22[/C][C]0.11[/C][/ROW] [C]8[/C][C]0.05[/C][C]0.1[/C][C]0.1[/C][C]0.05[/C][C]0.3[/C][C]0.45[/C][C]0.8[/C][C]0.85[/C][C]0.85[/C][C]1.61[/C][C]1.56[/C][C]1.06[/C][C]0.35[/C][C]0.25[/C][C]0.4[/C][C]0.2[/C][/ROW] [C]9[/C][C]0.2[/C][C]0.4[/C][C]0.4[/C][C]0.2[/C][C]1.21[/C][C]1.81[/C][C]3.22[/C][C]3.42[/C][C]3.42[/C][C]6.44[/C][C]6.23[/C][C]4.22[/C][C]1.41[/C][C]1.01[/C][C]1.61[/C][C]0.8[/C][/ROW] [C]10[/C][C]0.13[/C][C]0.27[/C][C]0.27[/C][C]0.13[/C][C]0.8[/C][C]1.21[/C][C]2.15[/C][C]2.28[/C][C]2.28[/C][C]4.29[/C][C]4.16[/C][C]2.82[/C][C]0.94[/C][C]0.67[/C][C]1.07[/C][C]0.54[/C][/ROW] [C]11[/C][C]0.16[/C][C]0.32[/C][C]0.32[/C][C]0.16[/C][C]0.97[/C][C]1.46[/C][C]2.59[/C][C]2.75[/C][C]2.75[/C][C]5.18[/C][C]5.02[/C][C]3.4[/C][C]1.13[/C][C]0.81[/C][C]1.3[/C][C]0.65[/C][/ROW] [C]12[/C][C]0.22[/C][C]0.44[/C][C]0.44[/C][C]0.22[/C][C]1.31[/C][C]1.96[/C][C]3.49[/C][C]3.7[/C][C]3.7[/C][C]6.97[/C][C]6.75[/C][C]4.58[/C][C]1.53[/C][C]1.09[/C][C]1.74[/C][C]0.87[/C][/ROW] [C]13[/C][C]0.04[/C][C]0.08[/C][C]0.08[/C][C]0.04[/C][C]0.23[/C][C]0.35[/C][C]0.63[/C][C]0.66[/C][C]0.66[/C][C]1.25[/C][C]1.21[/C][C]0.82[/C][C]0.27[/C][C]0.2[/C][C]0.31[/C][C]0.16[/C][/ROW] [C]14[/C][C]0.04[/C][C]0.08[/C][C]0.08[/C][C]0.04[/C][C]0.23[/C][C]0.35[/C][C]0.63[/C][C]0.66[/C][C]0.66[/C][C]1.25[/C][C]1.21[/C][C]0.82[/C][C]0.27[/C][C]0.2[/C][C]0.31[/C][C]0.16[/C][/ROW] [C]15[/C][C]0.06[/C][C]0.12[/C][C]0.12[/C][C]0.06[/C][C]0.37[/C][C]0.55[/C][C]0.98[/C][C]1.04[/C][C]1.04[/C][C]1.97[/C][C]1.91[/C][C]1.29[/C][C]0.43[/C][C]0.31[/C][C]0.49[/C][C]0.25[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=314393&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314393&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
Perceived_Usefulness x Perceived_Ease_of_Use
567891011121314151617181920
30.010.010.010.010.030.050.090.090.090.180.170.120.040.030.040.02
60.060.120.120.060.370.550.981.041.041.971.911.290.430.310.490.25
70.030.060.060.030.170.250.450.470.470.890.870.590.20.140.220.11
80.050.10.10.050.30.450.80.850.851.611.561.060.350.250.40.2
90.20.40.40.21.211.813.223.423.426.446.234.221.411.011.610.8
100.130.270.270.130.81.212.152.282.284.294.162.820.940.671.070.54
110.160.320.320.160.971.462.592.752.755.185.023.41.130.811.30.65
120.220.440.440.221.311.963.493.73.76.976.754.581.531.091.740.87
130.040.080.080.040.230.350.630.660.661.251.210.820.270.20.310.16
140.040.080.080.040.230.350.630.660.661.251.210.820.270.20.310.16
150.060.120.120.060.370.550.981.041.041.971.911.290.430.310.490.25







Statistical Results
Pearson's Chi-squared test
Pearson Chi Square Statistic394.05
Degrees of Freedom150
P value0

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314393&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 Statistic394.05
Degrees of Freedom150
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')