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 computationMon, 15 Dec 2014 18:55:08 +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/15/t1418670034juaknyi4ox9pgq1.htm/, Retrieved Thu, 16 May 2024 15:14:29 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=268908, Retrieved Thu, 16 May 2024 15:14:29 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact60
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Histogram] [skew1] [2014-12-13 18:52:26] [6aa28f01a40e2da66a40e1bfb2b28c13]
- RMPD    [Chi-Squared Test, McNemar Test, and Fisher Exact Test] [] [2014-12-15 18:55:08] [9a966322e4d935aee68609d815c1a240] [Current]
Feedback Forum

Post a new message
Dataseries X:
26 1
51 1
57 1
37 1
67 1
43 1
52 1
52 1
43 1
84 1
67 1
49 1
70 1
58 1
68 1
62 0
43 1
56 1
74 1
63 1
58 1
63 1
53 1
57 0
64 1
53 1
29 1
54 1
58 1
51 1
54 1
56 0
47 1
50 1
35 1
30 0
68 1
56 0
43 1
67 0
62 1
57 1
54 1
61 1
56 1
41 1
53 1
46 1
51 1
37 1
42 1
38 0
66 1
53 1
49 0
49 0
59 0
40 0
63 0
34 0
32 0
67 0
61 0
60 0
63 0
52 1
16 1
46 1
56 1
52 0
55 0
50 1
59 1
60 1
52 1
44 1
67 1
52 1
55 1
37 1
54 1
72 0
51 1
48 1
60 1
50 1
63 1
33 1
67 1
46 1
54 1
59 1
61 1
33 0
47 1
69 1
52 1
55 1
55 1
41 1
73 1
51 1
52 1
50 1
51 1
60 1
56 1
56 1
29 1
66 0
66 0
73 1
55 1
64 0
40 0
46 0
58 0
43 1
61 1
51 0
50 0
52 0
54 0
66 0
61 0
80 0
51 0
56 0
56 1
56 1
53 0
47 1
25 1
47 0
46 1
50 0
39 0
51 1
58 0
35 0
58 0
60 0
62 0
63 0
53 0
46 0
67 0
59 0
64 0
38 0
50 0
48 1
48 0
47 0
66 0
47 1
63 0
58 1
44 0
51 1
43 0
55 1
38 0
56 0
45 0
50 0
54 0
57 1
60 1
55 0
56 1
49 1
37 0
43 1
59 1
46 0
51 0
58 1
64 0
53 1
48 1
51 1
47 0
59 1
62 0
62 1
51 1
64 1
52 1
67 0
50 1
54 1
58 1
56 0
63 1
31 1
65 0
71 1
50 0
57 0
47 0
54 1
47 0
57 0
43 1
41 1
63 1
63 1
56 1
51 1
50 0
22 0
41 1
59 0
56 0
66 1
53 0
42 0
52 0
54 0
44 0
62 0
53 0
50 0
36 0
76 0
66 0
62 0
59 0
47 0
55 0
58 0
60 0
44 1
57 0
45 0




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=268908&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=268908&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=268908&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
AMS.I x s/b_(s_=_1)
01
1601
2210
2501
2601
2902
3010
3101
3210
3311
3410
3511
3610
3713
3830
3910
4020
4104
4211
4317
4422
4520
4634
4764
4813
4922
5075
51311
5238
5345
5437
5535
5669
5743
5846
5944
6034
6123
6252
6346
6432
6510
6652
6744
6802
6901
7001
7101
7210
7302
7401
7610
8010
8401

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
AMS.I  x  s/b_(s_=_1) \tabularnewline
  & 0 & 1 \tabularnewline
16 & 0 & 1 \tabularnewline
22 & 1 & 0 \tabularnewline
25 & 0 & 1 \tabularnewline
26 & 0 & 1 \tabularnewline
29 & 0 & 2 \tabularnewline
30 & 1 & 0 \tabularnewline
31 & 0 & 1 \tabularnewline
32 & 1 & 0 \tabularnewline
33 & 1 & 1 \tabularnewline
34 & 1 & 0 \tabularnewline
35 & 1 & 1 \tabularnewline
36 & 1 & 0 \tabularnewline
37 & 1 & 3 \tabularnewline
38 & 3 & 0 \tabularnewline
39 & 1 & 0 \tabularnewline
40 & 2 & 0 \tabularnewline
41 & 0 & 4 \tabularnewline
42 & 1 & 1 \tabularnewline
43 & 1 & 7 \tabularnewline
44 & 2 & 2 \tabularnewline
45 & 2 & 0 \tabularnewline
46 & 3 & 4 \tabularnewline
47 & 6 & 4 \tabularnewline
48 & 1 & 3 \tabularnewline
49 & 2 & 2 \tabularnewline
50 & 7 & 5 \tabularnewline
51 & 3 & 11 \tabularnewline
52 & 3 & 8 \tabularnewline
53 & 4 & 5 \tabularnewline
54 & 3 & 7 \tabularnewline
55 & 3 & 5 \tabularnewline
56 & 6 & 9 \tabularnewline
57 & 4 & 3 \tabularnewline
58 & 4 & 6 \tabularnewline
59 & 4 & 4 \tabularnewline
60 & 3 & 4 \tabularnewline
61 & 2 & 3 \tabularnewline
62 & 5 & 2 \tabularnewline
63 & 4 & 6 \tabularnewline
64 & 3 & 2 \tabularnewline
65 & 1 & 0 \tabularnewline
66 & 5 & 2 \tabularnewline
67 & 4 & 4 \tabularnewline
68 & 0 & 2 \tabularnewline
69 & 0 & 1 \tabularnewline
70 & 0 & 1 \tabularnewline
71 & 0 & 1 \tabularnewline
72 & 1 & 0 \tabularnewline
73 & 0 & 2 \tabularnewline
74 & 0 & 1 \tabularnewline
76 & 1 & 0 \tabularnewline
80 & 1 & 0 \tabularnewline
84 & 0 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=268908&T=1

[TABLE]
[ROW][C]Tabulation of Results[/C][/ROW]
[ROW][C]AMS.I  x  s/b_(s_=_1)[/C][/ROW]
[ROW][C] [/C][C]0[/C][C]1[/C][/ROW]
[C]16[/C][C]0[/C][C]1[/C][/ROW]
[C]22[/C][C]1[/C][C]0[/C][/ROW]
[C]25[/C][C]0[/C][C]1[/C][/ROW]
[C]26[/C][C]0[/C][C]1[/C][/ROW]
[C]29[/C][C]0[/C][C]2[/C][/ROW]
[C]30[/C][C]1[/C][C]0[/C][/ROW]
[C]31[/C][C]0[/C][C]1[/C][/ROW]
[C]32[/C][C]1[/C][C]0[/C][/ROW]
[C]33[/C][C]1[/C][C]1[/C][/ROW]
[C]34[/C][C]1[/C][C]0[/C][/ROW]
[C]35[/C][C]1[/C][C]1[/C][/ROW]
[C]36[/C][C]1[/C][C]0[/C][/ROW]
[C]37[/C][C]1[/C][C]3[/C][/ROW]
[C]38[/C][C]3[/C][C]0[/C][/ROW]
[C]39[/C][C]1[/C][C]0[/C][/ROW]
[C]40[/C][C]2[/C][C]0[/C][/ROW]
[C]41[/C][C]0[/C][C]4[/C][/ROW]
[C]42[/C][C]1[/C][C]1[/C][/ROW]
[C]43[/C][C]1[/C][C]7[/C][/ROW]
[C]44[/C][C]2[/C][C]2[/C][/ROW]
[C]45[/C][C]2[/C][C]0[/C][/ROW]
[C]46[/C][C]3[/C][C]4[/C][/ROW]
[C]47[/C][C]6[/C][C]4[/C][/ROW]
[C]48[/C][C]1[/C][C]3[/C][/ROW]
[C]49[/C][C]2[/C][C]2[/C][/ROW]
[C]50[/C][C]7[/C][C]5[/C][/ROW]
[C]51[/C][C]3[/C][C]11[/C][/ROW]
[C]52[/C][C]3[/C][C]8[/C][/ROW]
[C]53[/C][C]4[/C][C]5[/C][/ROW]
[C]54[/C][C]3[/C][C]7[/C][/ROW]
[C]55[/C][C]3[/C][C]5[/C][/ROW]
[C]56[/C][C]6[/C][C]9[/C][/ROW]
[C]57[/C][C]4[/C][C]3[/C][/ROW]
[C]58[/C][C]4[/C][C]6[/C][/ROW]
[C]59[/C][C]4[/C][C]4[/C][/ROW]
[C]60[/C][C]3[/C][C]4[/C][/ROW]
[C]61[/C][C]2[/C][C]3[/C][/ROW]
[C]62[/C][C]5[/C][C]2[/C][/ROW]
[C]63[/C][C]4[/C][C]6[/C][/ROW]
[C]64[/C][C]3[/C][C]2[/C][/ROW]
[C]65[/C][C]1[/C][C]0[/C][/ROW]
[C]66[/C][C]5[/C][C]2[/C][/ROW]
[C]67[/C][C]4[/C][C]4[/C][/ROW]
[C]68[/C][C]0[/C][C]2[/C][/ROW]
[C]69[/C][C]0[/C][C]1[/C][/ROW]
[C]70[/C][C]0[/C][C]1[/C][/ROW]
[C]71[/C][C]0[/C][C]1[/C][/ROW]
[C]72[/C][C]1[/C][C]0[/C][/ROW]
[C]73[/C][C]0[/C][C]2[/C][/ROW]
[C]74[/C][C]0[/C][C]1[/C][/ROW]
[C]76[/C][C]1[/C][C]0[/C][/ROW]
[C]80[/C][C]1[/C][C]0[/C][/ROW]
[C]84[/C][C]0[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=268908&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=268908&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
AMS.I x s/b_(s_=_1)
01
1601
2210
2501
2601
2902
3010
3101
3210
3311
3410
3511
3610
3713
3830
3910
4020
4104
4211
4317
4422
4520
4634
4764
4813
4922
5075
51311
5238
5345
5437
5535
5669
5743
5846
5944
6034
6123
6252
6346
6432
6510
6652
6744
6802
6901
7001
7101
7210
7302
7401
7610
8010
8401







Tabulation of Expected Results
AMS.I x s/b_(s_=_1)
01
160.440.56
220.440.56
250.440.56
260.440.56
290.871.13
300.440.56
310.440.56
320.440.56
330.871.13
340.440.56
350.871.13
360.440.56
371.752.25
381.311.69
390.440.56
400.871.13
411.752.25
420.871.13
433.494.51
441.752.25
450.871.13
463.063.94
474.365.64
481.752.25
491.752.25
505.246.76
516.117.89
524.86.2
533.935.07
544.365.64
553.494.51
566.558.45
573.063.94
584.365.64
593.494.51
603.063.94
612.182.82
623.063.94
634.365.64
642.182.82
650.440.56
663.063.94
673.494.51
680.871.13
690.440.56
700.440.56
710.440.56
720.440.56
730.871.13
740.440.56
760.440.56
800.440.56
840.440.56

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
AMS.I  x  s/b_(s_=_1) \tabularnewline
  & 0 & 1 \tabularnewline
16 & 0.44 & 0.56 \tabularnewline
22 & 0.44 & 0.56 \tabularnewline
25 & 0.44 & 0.56 \tabularnewline
26 & 0.44 & 0.56 \tabularnewline
29 & 0.87 & 1.13 \tabularnewline
30 & 0.44 & 0.56 \tabularnewline
31 & 0.44 & 0.56 \tabularnewline
32 & 0.44 & 0.56 \tabularnewline
33 & 0.87 & 1.13 \tabularnewline
34 & 0.44 & 0.56 \tabularnewline
35 & 0.87 & 1.13 \tabularnewline
36 & 0.44 & 0.56 \tabularnewline
37 & 1.75 & 2.25 \tabularnewline
38 & 1.31 & 1.69 \tabularnewline
39 & 0.44 & 0.56 \tabularnewline
40 & 0.87 & 1.13 \tabularnewline
41 & 1.75 & 2.25 \tabularnewline
42 & 0.87 & 1.13 \tabularnewline
43 & 3.49 & 4.51 \tabularnewline
44 & 1.75 & 2.25 \tabularnewline
45 & 0.87 & 1.13 \tabularnewline
46 & 3.06 & 3.94 \tabularnewline
47 & 4.36 & 5.64 \tabularnewline
48 & 1.75 & 2.25 \tabularnewline
49 & 1.75 & 2.25 \tabularnewline
50 & 5.24 & 6.76 \tabularnewline
51 & 6.11 & 7.89 \tabularnewline
52 & 4.8 & 6.2 \tabularnewline
53 & 3.93 & 5.07 \tabularnewline
54 & 4.36 & 5.64 \tabularnewline
55 & 3.49 & 4.51 \tabularnewline
56 & 6.55 & 8.45 \tabularnewline
57 & 3.06 & 3.94 \tabularnewline
58 & 4.36 & 5.64 \tabularnewline
59 & 3.49 & 4.51 \tabularnewline
60 & 3.06 & 3.94 \tabularnewline
61 & 2.18 & 2.82 \tabularnewline
62 & 3.06 & 3.94 \tabularnewline
63 & 4.36 & 5.64 \tabularnewline
64 & 2.18 & 2.82 \tabularnewline
65 & 0.44 & 0.56 \tabularnewline
66 & 3.06 & 3.94 \tabularnewline
67 & 3.49 & 4.51 \tabularnewline
68 & 0.87 & 1.13 \tabularnewline
69 & 0.44 & 0.56 \tabularnewline
70 & 0.44 & 0.56 \tabularnewline
71 & 0.44 & 0.56 \tabularnewline
72 & 0.44 & 0.56 \tabularnewline
73 & 0.87 & 1.13 \tabularnewline
74 & 0.44 & 0.56 \tabularnewline
76 & 0.44 & 0.56 \tabularnewline
80 & 0.44 & 0.56 \tabularnewline
84 & 0.44 & 0.56 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=268908&T=2

[TABLE]
[ROW][C]Tabulation of Expected Results[/C][/ROW]
[ROW][C]AMS.I  x  s/b_(s_=_1)[/C][/ROW]
[ROW][C] [/C][C]0[/C][C]1[/C][/ROW]
[C]16[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]22[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]25[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]26[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]29[/C][C]0.87[/C][C]1.13[/C][/ROW]
[C]30[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]31[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]32[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]33[/C][C]0.87[/C][C]1.13[/C][/ROW]
[C]34[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]35[/C][C]0.87[/C][C]1.13[/C][/ROW]
[C]36[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]37[/C][C]1.75[/C][C]2.25[/C][/ROW]
[C]38[/C][C]1.31[/C][C]1.69[/C][/ROW]
[C]39[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]40[/C][C]0.87[/C][C]1.13[/C][/ROW]
[C]41[/C][C]1.75[/C][C]2.25[/C][/ROW]
[C]42[/C][C]0.87[/C][C]1.13[/C][/ROW]
[C]43[/C][C]3.49[/C][C]4.51[/C][/ROW]
[C]44[/C][C]1.75[/C][C]2.25[/C][/ROW]
[C]45[/C][C]0.87[/C][C]1.13[/C][/ROW]
[C]46[/C][C]3.06[/C][C]3.94[/C][/ROW]
[C]47[/C][C]4.36[/C][C]5.64[/C][/ROW]
[C]48[/C][C]1.75[/C][C]2.25[/C][/ROW]
[C]49[/C][C]1.75[/C][C]2.25[/C][/ROW]
[C]50[/C][C]5.24[/C][C]6.76[/C][/ROW]
[C]51[/C][C]6.11[/C][C]7.89[/C][/ROW]
[C]52[/C][C]4.8[/C][C]6.2[/C][/ROW]
[C]53[/C][C]3.93[/C][C]5.07[/C][/ROW]
[C]54[/C][C]4.36[/C][C]5.64[/C][/ROW]
[C]55[/C][C]3.49[/C][C]4.51[/C][/ROW]
[C]56[/C][C]6.55[/C][C]8.45[/C][/ROW]
[C]57[/C][C]3.06[/C][C]3.94[/C][/ROW]
[C]58[/C][C]4.36[/C][C]5.64[/C][/ROW]
[C]59[/C][C]3.49[/C][C]4.51[/C][/ROW]
[C]60[/C][C]3.06[/C][C]3.94[/C][/ROW]
[C]61[/C][C]2.18[/C][C]2.82[/C][/ROW]
[C]62[/C][C]3.06[/C][C]3.94[/C][/ROW]
[C]63[/C][C]4.36[/C][C]5.64[/C][/ROW]
[C]64[/C][C]2.18[/C][C]2.82[/C][/ROW]
[C]65[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]66[/C][C]3.06[/C][C]3.94[/C][/ROW]
[C]67[/C][C]3.49[/C][C]4.51[/C][/ROW]
[C]68[/C][C]0.87[/C][C]1.13[/C][/ROW]
[C]69[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]70[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]71[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]72[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]73[/C][C]0.87[/C][C]1.13[/C][/ROW]
[C]74[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]76[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]80[/C][C]0.44[/C][C]0.56[/C][/ROW]
[C]84[/C][C]0.44[/C][C]0.56[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=268908&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=268908&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
AMS.I x s/b_(s_=_1)
01
160.440.56
220.440.56
250.440.56
260.440.56
290.871.13
300.440.56
310.440.56
320.440.56
330.871.13
340.440.56
350.871.13
360.440.56
371.752.25
381.311.69
390.440.56
400.871.13
411.752.25
420.871.13
433.494.51
441.752.25
450.871.13
463.063.94
474.365.64
481.752.25
491.752.25
505.246.76
516.117.89
524.86.2
533.935.07
544.365.64
553.494.51
566.558.45
573.063.94
584.365.64
593.494.51
603.063.94
612.182.82
623.063.94
634.365.64
642.182.82
650.440.56
663.063.94
673.494.51
680.871.13
690.440.56
700.440.56
710.440.56
720.440.56
730.871.13
740.440.56
760.440.56
800.440.56
840.440.56







Statistical Results
Pearson's Chi-squared test
Pearson Chi Square Statistic54.15
Degrees of Freedom52
P value0.39

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=268908&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 Statistic54.15
Degrees of Freedom52
P value0.39



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