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 computationTue, 14 Dec 2010 08:40:18 +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/2010/Dec/14/t1292316105521idqrbayt938v.htm/, Retrieved Fri, 03 May 2024 03:25:02 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=109259, Retrieved Fri, 03 May 2024 03:25:02 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact212
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ECEL 2008] [ECEL2008 hypothes...] [2008-06-14 21:17:24] [74be16979710d4c4e7c6647856088456]
- RMPD  [Chi-Squared and McNemar Tests] [Chi squared 1] [2010-11-05 22:27:37] [97ad38b1c3b35a5feca8b85f7bc7b3ff]
F R PD    [Chi-Squared and McNemar Tests] [Connected versus ...] [2010-11-10 15:52:22] [95e8426e0df851c9330605aa1e892ab5]
-   PD        [Chi-Squared Test, McNemar Test, and Fisher Exact Test] [science paper fout 2] [2010-12-14 08:40:18] [dc77c696707133dea0955379c56a2acd] [Current]
Feedback Forum

Post a new message
Dataseries X:
6,3	2	4,5	1	6,6	42	3	1	3
2,1	1,8	69	2547	4603	624	3	5	4
9,1	0,7	27	10,55	179,5	180	4	4	4
15,8	3,9	19	0,023	0,3	35	1	1	1
5,2	1	30,4	160	169	392	4	5	4
10,9	3,6	28	3,3	25,6	63	1	2	1
8,3	1,4	50	52,16	440	230	1	1	1
11	1,5	7	0,425	6,4	112	5	4	4
3,2	0,7	30	465	423	281	5	5	5
6,3	2,1	3,5	0,075	1,2	42	1	1	1
8,6	0	50	3	25	28	2	2	2
6,6	4,1	6	0,785	3,5	42	2	2	2
9,5	1,2	10,4	0,2	5	120	2	2	2
3,3	0,5	20	27,66	115	148	5	5	5
11	3,4	3,9	0,12	1	16	3	1	2
4,7	1,5	41	85	325	310	1	3	1
10,4	3,4	9	0,101	4	28	5	1	3
7,4	0,8	7,6	1,04	5,5	68	5	3	4
2,1	0,8	46	521	655	336	5	5	5
7,7	1,4	2,6	0,005	0,14	21,5	5	2	4
17,9	2	24	0,01	0,25	50	1	1	1
6,1	1,9	100	62	1320	267	1	1	1
11,9	1,3	3,2	0,023	0,4	19	4	1	3
10,8	2	2	0,048	0,33	30	4	1	3
13,8	5,6	5	1,7	6,3	12	2	1	1
14,3	3,1	6,5	3,5	10,8	120	2	1	1
15,2	1,8	12	0,48	15,5	140	2	2	2
10	0,9	20,2	10	115	170	4	4	4
11,9	1,8	13	1,62	11,4	17	2	1	2
6,5	1,9	27	192	180	115	4	4	4
7,5	0,9	18	2,5	12,1	31	5	5	5
10,6	2,6	4,7	0,28	1,9	21	3	1	3
7,4	2,4	9,8	4,235	50,4	52	1	1	1
8,4	1,2	29	6,8	179	164	2	3	2
5,7	0,9	7	0,75	12,3	225	2	2	2
4,9	0,5	6	3,6	21	225	3	2	3
3,2	0,6	20	55,5	175	151	5	5	5
11	2,3	4,5	0,9	2,6	60	2	1	2
4,9	0,5	7,5	2	12,3	200	3	1	3
13,2	2,6	2,3	0,104	2,5	46	3	2	2
9,7	0,6	24	4,19	58	210	4	3	4
12,8	6,6	3	3,5	3,9	14	2	1	1




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time6 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 6 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109259&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]6 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109259&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109259&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 time6 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







Tabulation of Results
PS x ODI
12345
001000
0.500201
0.600011
0.700011
0.800011
0.901011
100010
1.202000
1.300100
1.410010
1.510010
1.802010
1.910010
210200
2.110000
2.301000
2.410000
2.601100
3.110000
3.401100
3.610000
3.910000
4.101000
5.610000
6.610000

\begin{tabular}{lllllllll}
\hline
Tabulation of Results \tabularnewline
PS  x  ODI \tabularnewline
  & 1 & 2 & 3 & 4 & 5 \tabularnewline
0 & 0 & 1 & 0 & 0 & 0 \tabularnewline
0.5 & 0 & 0 & 2 & 0 & 1 \tabularnewline
0.6 & 0 & 0 & 0 & 1 & 1 \tabularnewline
0.7 & 0 & 0 & 0 & 1 & 1 \tabularnewline
0.8 & 0 & 0 & 0 & 1 & 1 \tabularnewline
0.9 & 0 & 1 & 0 & 1 & 1 \tabularnewline
1 & 0 & 0 & 0 & 1 & 0 \tabularnewline
1.2 & 0 & 2 & 0 & 0 & 0 \tabularnewline
1.3 & 0 & 0 & 1 & 0 & 0 \tabularnewline
1.4 & 1 & 0 & 0 & 1 & 0 \tabularnewline
1.5 & 1 & 0 & 0 & 1 & 0 \tabularnewline
1.8 & 0 & 2 & 0 & 1 & 0 \tabularnewline
1.9 & 1 & 0 & 0 & 1 & 0 \tabularnewline
2 & 1 & 0 & 2 & 0 & 0 \tabularnewline
2.1 & 1 & 0 & 0 & 0 & 0 \tabularnewline
2.3 & 0 & 1 & 0 & 0 & 0 \tabularnewline
2.4 & 1 & 0 & 0 & 0 & 0 \tabularnewline
2.6 & 0 & 1 & 1 & 0 & 0 \tabularnewline
3.1 & 1 & 0 & 0 & 0 & 0 \tabularnewline
3.4 & 0 & 1 & 1 & 0 & 0 \tabularnewline
3.6 & 1 & 0 & 0 & 0 & 0 \tabularnewline
3.9 & 1 & 0 & 0 & 0 & 0 \tabularnewline
4.1 & 0 & 1 & 0 & 0 & 0 \tabularnewline
5.6 & 1 & 0 & 0 & 0 & 0 \tabularnewline
6.6 & 1 & 0 & 0 & 0 & 0 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109259&T=1

[TABLE]
[ROW][C]Tabulation of Results[/C][/ROW]
[ROW][C]PS  x  ODI[/C][/ROW]
[ROW][C] [/C][C]1[/C][C]2[/C][C]3[/C][C]4[/C][C]5[/C][/ROW]
[C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]0.5[/C][C]0[/C][C]0[/C][C]2[/C][C]0[/C][C]1[/C][/ROW]
[C]0.6[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[C]0.7[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[C]0.8[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[C]0.9[/C][C]0[/C][C]1[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[C]1.2[/C][C]0[/C][C]2[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]1.3[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][/ROW]
[C]1.4[/C][C]1[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[C]1.5[/C][C]1[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[C]1.8[/C][C]0[/C][C]2[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[C]1.9[/C][C]1[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[C]2[/C][C]1[/C][C]0[/C][C]2[/C][C]0[/C][C]0[/C][/ROW]
[C]2.1[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]2.3[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]2.4[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]2.6[/C][C]0[/C][C]1[/C][C]1[/C][C]0[/C][C]0[/C][/ROW]
[C]3.1[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]3.4[/C][C]0[/C][C]1[/C][C]1[/C][C]0[/C][C]0[/C][/ROW]
[C]3.6[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]3.9[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]4.1[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]5.6[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[C]6.6[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109259&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109259&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
PS x ODI
12345
001000
0.500201
0.600011
0.700011
0.800011
0.901011
100010
1.202000
1.300100
1.410010
1.510010
1.802010
1.910010
210200
2.110000
2.301000
2.410000
2.601100
3.110000
3.401100
3.610000
3.910000
4.101000
5.610000
6.610000







Tabulation of Expected Results
PS x ODI
12345
00.260.240.170.210.12
0.50.790.710.50.640.36
0.60.520.480.330.430.24
0.70.520.480.330.430.24
0.80.520.480.330.430.24
0.90.790.710.50.640.36
10.260.240.170.210.12
1.20.520.480.330.430.24
1.30.260.240.170.210.12
1.40.520.480.330.430.24
1.50.520.480.330.430.24
1.80.790.710.50.640.36
1.90.520.480.330.430.24
20.790.710.50.640.36
2.10.260.240.170.210.12
2.30.260.240.170.210.12
2.40.260.240.170.210.12
2.60.520.480.330.430.24
3.10.260.240.170.210.12
3.40.520.480.330.430.24
3.60.260.240.170.210.12
3.90.260.240.170.210.12
4.10.260.240.170.210.12
5.60.260.240.170.210.12
6.60.260.240.170.210.12

\begin{tabular}{lllllllll}
\hline
Tabulation of Expected Results \tabularnewline
PS  x  ODI \tabularnewline
  & 1 & 2 & 3 & 4 & 5 \tabularnewline
0 & 0.26 & 0.24 & 0.17 & 0.21 & 0.12 \tabularnewline
0.5 & 0.79 & 0.71 & 0.5 & 0.64 & 0.36 \tabularnewline
0.6 & 0.52 & 0.48 & 0.33 & 0.43 & 0.24 \tabularnewline
0.7 & 0.52 & 0.48 & 0.33 & 0.43 & 0.24 \tabularnewline
0.8 & 0.52 & 0.48 & 0.33 & 0.43 & 0.24 \tabularnewline
0.9 & 0.79 & 0.71 & 0.5 & 0.64 & 0.36 \tabularnewline
1 & 0.26 & 0.24 & 0.17 & 0.21 & 0.12 \tabularnewline
1.2 & 0.52 & 0.48 & 0.33 & 0.43 & 0.24 \tabularnewline
1.3 & 0.26 & 0.24 & 0.17 & 0.21 & 0.12 \tabularnewline
1.4 & 0.52 & 0.48 & 0.33 & 0.43 & 0.24 \tabularnewline
1.5 & 0.52 & 0.48 & 0.33 & 0.43 & 0.24 \tabularnewline
1.8 & 0.79 & 0.71 & 0.5 & 0.64 & 0.36 \tabularnewline
1.9 & 0.52 & 0.48 & 0.33 & 0.43 & 0.24 \tabularnewline
2 & 0.79 & 0.71 & 0.5 & 0.64 & 0.36 \tabularnewline
2.1 & 0.26 & 0.24 & 0.17 & 0.21 & 0.12 \tabularnewline
2.3 & 0.26 & 0.24 & 0.17 & 0.21 & 0.12 \tabularnewline
2.4 & 0.26 & 0.24 & 0.17 & 0.21 & 0.12 \tabularnewline
2.6 & 0.52 & 0.48 & 0.33 & 0.43 & 0.24 \tabularnewline
3.1 & 0.26 & 0.24 & 0.17 & 0.21 & 0.12 \tabularnewline
3.4 & 0.52 & 0.48 & 0.33 & 0.43 & 0.24 \tabularnewline
3.6 & 0.26 & 0.24 & 0.17 & 0.21 & 0.12 \tabularnewline
3.9 & 0.26 & 0.24 & 0.17 & 0.21 & 0.12 \tabularnewline
4.1 & 0.26 & 0.24 & 0.17 & 0.21 & 0.12 \tabularnewline
5.6 & 0.26 & 0.24 & 0.17 & 0.21 & 0.12 \tabularnewline
6.6 & 0.26 & 0.24 & 0.17 & 0.21 & 0.12 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109259&T=2

[TABLE]
[ROW][C]Tabulation of Expected Results[/C][/ROW]
[ROW][C]PS  x  ODI[/C][/ROW]
[ROW][C] [/C][C]1[/C][C]2[/C][C]3[/C][C]4[/C][C]5[/C][/ROW]
[C]0[/C][C]0.26[/C][C]0.24[/C][C]0.17[/C][C]0.21[/C][C]0.12[/C][/ROW]
[C]0.5[/C][C]0.79[/C][C]0.71[/C][C]0.5[/C][C]0.64[/C][C]0.36[/C][/ROW]
[C]0.6[/C][C]0.52[/C][C]0.48[/C][C]0.33[/C][C]0.43[/C][C]0.24[/C][/ROW]
[C]0.7[/C][C]0.52[/C][C]0.48[/C][C]0.33[/C][C]0.43[/C][C]0.24[/C][/ROW]
[C]0.8[/C][C]0.52[/C][C]0.48[/C][C]0.33[/C][C]0.43[/C][C]0.24[/C][/ROW]
[C]0.9[/C][C]0.79[/C][C]0.71[/C][C]0.5[/C][C]0.64[/C][C]0.36[/C][/ROW]
[C]1[/C][C]0.26[/C][C]0.24[/C][C]0.17[/C][C]0.21[/C][C]0.12[/C][/ROW]
[C]1.2[/C][C]0.52[/C][C]0.48[/C][C]0.33[/C][C]0.43[/C][C]0.24[/C][/ROW]
[C]1.3[/C][C]0.26[/C][C]0.24[/C][C]0.17[/C][C]0.21[/C][C]0.12[/C][/ROW]
[C]1.4[/C][C]0.52[/C][C]0.48[/C][C]0.33[/C][C]0.43[/C][C]0.24[/C][/ROW]
[C]1.5[/C][C]0.52[/C][C]0.48[/C][C]0.33[/C][C]0.43[/C][C]0.24[/C][/ROW]
[C]1.8[/C][C]0.79[/C][C]0.71[/C][C]0.5[/C][C]0.64[/C][C]0.36[/C][/ROW]
[C]1.9[/C][C]0.52[/C][C]0.48[/C][C]0.33[/C][C]0.43[/C][C]0.24[/C][/ROW]
[C]2[/C][C]0.79[/C][C]0.71[/C][C]0.5[/C][C]0.64[/C][C]0.36[/C][/ROW]
[C]2.1[/C][C]0.26[/C][C]0.24[/C][C]0.17[/C][C]0.21[/C][C]0.12[/C][/ROW]
[C]2.3[/C][C]0.26[/C][C]0.24[/C][C]0.17[/C][C]0.21[/C][C]0.12[/C][/ROW]
[C]2.4[/C][C]0.26[/C][C]0.24[/C][C]0.17[/C][C]0.21[/C][C]0.12[/C][/ROW]
[C]2.6[/C][C]0.52[/C][C]0.48[/C][C]0.33[/C][C]0.43[/C][C]0.24[/C][/ROW]
[C]3.1[/C][C]0.26[/C][C]0.24[/C][C]0.17[/C][C]0.21[/C][C]0.12[/C][/ROW]
[C]3.4[/C][C]0.52[/C][C]0.48[/C][C]0.33[/C][C]0.43[/C][C]0.24[/C][/ROW]
[C]3.6[/C][C]0.26[/C][C]0.24[/C][C]0.17[/C][C]0.21[/C][C]0.12[/C][/ROW]
[C]3.9[/C][C]0.26[/C][C]0.24[/C][C]0.17[/C][C]0.21[/C][C]0.12[/C][/ROW]
[C]4.1[/C][C]0.26[/C][C]0.24[/C][C]0.17[/C][C]0.21[/C][C]0.12[/C][/ROW]
[C]5.6[/C][C]0.26[/C][C]0.24[/C][C]0.17[/C][C]0.21[/C][C]0.12[/C][/ROW]
[C]6.6[/C][C]0.26[/C][C]0.24[/C][C]0.17[/C][C]0.21[/C][C]0.12[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109259&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109259&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
PS x ODI
12345
00.260.240.170.210.12
0.50.790.710.50.640.36
0.60.520.480.330.430.24
0.70.520.480.330.430.24
0.80.520.480.330.430.24
0.90.790.710.50.640.36
10.260.240.170.210.12
1.20.520.480.330.430.24
1.30.260.240.170.210.12
1.40.520.480.330.430.24
1.50.520.480.330.430.24
1.80.790.710.50.640.36
1.90.520.480.330.430.24
20.790.710.50.640.36
2.10.260.240.170.210.12
2.30.260.240.170.210.12
2.40.260.240.170.210.12
2.60.520.480.330.430.24
3.10.260.240.170.210.12
3.40.520.480.330.430.24
3.60.260.240.170.210.12
3.90.260.240.170.210.12
4.10.260.240.170.210.12
5.60.260.240.170.210.12
6.60.260.240.170.210.12







Statistical Results
Pearson's Chi-squared test
Chi Square Statistic91.91
Degrees of Freedom96
P value0.6

\begin{tabular}{lllllllll}
\hline
Statistical Results \tabularnewline
Pearson's Chi-squared test \tabularnewline
Chi Square Statistic & 91.91 \tabularnewline
Degrees of Freedom & 96 \tabularnewline
P value & 0.6 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109259&T=3

[TABLE]
[ROW][C]Statistical Results[/C][/ROW]
[ROW][C]Pearson's Chi-squared test[/C][/ROW]
[ROW][C]Chi Square Statistic[/C][C]91.91[/C][/ROW]
[ROW][C]Degrees of Freedom[/C][C]96[/C][/ROW]
[ROW][C]P value[/C][C]0.6[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109259&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109259&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
Chi Square Statistic91.91
Degrees of Freedom96
P value0.6



Parameters (Session):
par1 = 2 ; par2 = 9 ; par3 = Pearson Chi-Squared ;
Parameters (R input):
par1 = 2 ; par2 = 9 ; 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 != 'McNemar Chi-Squared') {
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)
a<-table.element(a, 'Chi Square Statistic', 1, TRUE)
a<-table.element(a, round(cst$statistic, digits=2), 1,FALSE)
a<-table.row.end(a)
if(!simulate.p.value){
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')