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 09:10:09 +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/t15174727379ossp4h4nhujwjq.htm/, Retrieved Sun, 28 Apr 2024 23:56:13 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=313326, Retrieved Sun, 28 Apr 2024 23:56:13 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact58
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 08:10:09] [469a2cadd589b423c2d787db5034925b] [Current]
Feedback Forum

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




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

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







Tabulation of Results
Perceived_Ease_of_Use x Perceived_Usefulness
36789101112131415
500010000000
610000100000
700011000000
801000000000
903001200000
1002400111000
1102123251000
1200025154000
1300025244000
1402017875110
15000094410211
16010032211110
1700001111111
1800001000112
1900000002123
2000000000004

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

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313326&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_Ease_of_Use x Perceived_Usefulness
36789101112131415
500010000000
610000100000
700011000000
801000000000
903001200000
1002400111000
1102123251000
1200025154000
1300025244000
1402017875110
15000094410211
16010032211110
1700001111111
1800001000112
1900000002123
2000000000004







Tabulation of Expected Results
Perceived_Ease_of_Use x Perceived_Usefulness
36789101112131415
50.010.060.030.050.20.130.160.220.040.040.06
60.010.120.060.10.40.270.320.440.080.080.12
70.010.120.060.10.40.270.320.440.080.080.12
80.010.060.030.050.20.130.160.220.040.040.06
90.030.370.170.31.210.80.971.310.230.230.37
100.050.550.250.451.811.211.461.960.350.350.55
110.090.980.450.83.222.152.593.490.630.630.98
120.091.040.470.853.422.282.753.70.660.661.04
130.091.040.470.853.422.282.753.70.660.661.04
140.181.970.891.616.444.295.186.971.251.251.97
150.171.910.871.566.234.165.026.751.211.211.91
160.121.290.591.064.222.823.44.580.820.821.29
170.040.430.20.351.410.941.131.530.270.270.43
180.030.310.140.251.010.670.811.090.20.20.31
190.040.490.220.41.611.071.31.740.310.310.49
200.020.250.110.20.80.540.650.870.160.160.25

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

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313326&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_Ease_of_Use x Perceived_Usefulness
36789101112131415
50.010.060.030.050.20.130.160.220.040.040.06
60.010.120.060.10.40.270.320.440.080.080.12
70.010.120.060.10.40.270.320.440.080.080.12
80.010.060.030.050.20.130.160.220.040.040.06
90.030.370.170.31.210.80.971.310.230.230.37
100.050.550.250.451.811.211.461.960.350.350.55
110.090.980.450.83.222.152.593.490.630.630.98
120.091.040.470.853.422.282.753.70.660.661.04
130.091.040.470.853.422.282.753.70.660.661.04
140.181.970.891.616.444.295.186.971.251.251.97
150.171.910.871.566.234.165.026.751.211.211.91
160.121.290.591.064.222.823.44.580.820.821.29
170.040.430.20.351.410.941.131.530.270.270.43
180.030.310.140.251.010.670.811.090.20.20.31
190.040.490.220.41.611.071.31.740.310.310.49
200.020.250.110.20.80.540.650.870.160.160.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=313326&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=313326&T=3

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