Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_Two Factor ANOVA.wasp
Title produced by softwareTwo-Way ANOVA
Date of computationSun, 09 Dec 2012 11:52:41 -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/2012/Dec/09/t13550720582b7taew3p5r7vf6.htm/, Retrieved Sat, 20 Apr 2024 03:06:06 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=197985, Retrieved Sat, 20 Apr 2024 03:06:06 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact132
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Two-Way ANOVA] [] [2010-11-02 14:42:14] [b98453cac15ba1066b407e146608df68]
- R PD    [Two-Way ANOVA] [Paper Two-way Anova] [2012-12-09 16:52:41] [c63d55528b56cf8bb48e0b5d1a959d8e] [Current]
Feedback Forum

Post a new message
Dataseries X:
89	'E'	64	'Pos'
89	'E'	56	'Pos'
70	'E'	25	'Pos'
69	'E'	25	'Pos'
65	'E'	5	'Pos'
64	'E'	19	'Pos'
56	'E'	10	'Pos'
52	'E'	7	'Pos'
52	'E'	-3	'Neg'
47	'E'	-7	'Neg'
47	'E'	-7	'Neg'
47	'E'	-14	'Neg'
45	'E'	-1	'Neg'
45	'E'	-17	'Neg'
43	'E'	-20	'Neg'
38	'E'	-16	'Neg'
37	'E'	-23	'Neg'
36	'E'	-31	'Neg'
31	'E'	-30	'Neg'
25	'E'	-42	'Neg'
84	'I'	48	'Pos'
80	'I'	41	'Pos'
64	'I'	17	'Pos'
62	'I'	9	'Pos'
61	'I'	20	'Pos'
58	'I'	3	'Pos'
56	'I'	6	'Pos'
56	'I'	1	'Pos'
51	'I'	-2	'Neg'
49	'I'	-10	'Neg'
48	'I'	-5	'Neg'
46	'I'	-2	'Neg'
46	'I'	-6	'Neg'
44	'I'	0	'Neg'
43	'I'	-10	'Neg'
43	'I'	-9	'Neg'
42	'I'	-19	'Neg'
36	'I'	-16	'Neg'
32	'I'	-30	'Neg'
22	'I'	-36	'Neg'
82	'F'	34	'Pos'
79	'F'	34	'Pos'
74	'F'	33	'Pos'
64	'F'	13	'Pos'
61	'F'	12	'Pos'
60	'F'	9	'Pos'
57	'F'	4	'Pos'
56	'F'	3	'Pos'
50	'F'	-1	'Neg'
48	'F'	4	'Pos'
45	'F'	-10	'Neg'
43	'F'	-10	'Neg'
42	'F'	-20	'Neg'
42	'F'	-7	'Neg'
41	'F'	-21	'Neg'
41	'F'	-7	'Neg'
39	'F'	-14	'Neg'
38	'F'	-20	'Neg'
36	'F'	-25	'Neg'
34	'F'	-11	'Neg'
100	'S'	89	'Pos'
91	'S'	85	'Pos'
61	'S'	15	'Pos'
58	'S'	1	'Pos'
56	'S'	7	'Pos'
55	'S'	4	'Pos'
54	'S'	-17	'Neg'
52	'S'	-4	'Neg'
50	'S'	1	'Pos'
49	'S'	-3	'Neg'
47	'S'	-9	'Neg'
47	'S'	-6	'Neg'
47	'S'	-11	'Neg'
46	'S'	-10	'Neg'
43	'S'	-20	'Neg'
43	'S'	-25	'Neg'
42	'S'	-21	'Neg'
41	'S'	-14	'Neg'
37	'S'	-27	'Neg'
27	'S'	-35	'Neg'




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=197985&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 time4 seconds
R Server'Sir Maurice George Kendall' @ kendall.wessa.net







ANOVA Model
Response ~ Treatment_A * Treatment_B
means41.083-0.0830.753.14728.167-4.611-4.875-5.112

\begin{tabular}{lllllllll}
\hline
ANOVA Model \tabularnewline
Response ~ Treatment_A * Treatment_B \tabularnewline
means & 41.083 & -0.083 & 0.75 & 3.147 & 28.167 & -4.611 & -4.875 & -5.112 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=197985&T=1

[TABLE]
[ROW][C]ANOVA Model[/C][/ROW]
[ROW][C]Response ~ Treatment_A * Treatment_B[/C][/ROW]
[ROW][C]means[/C][C]41.083[/C][C]-0.083[/C][C]0.75[/C][C]3.147[/C][C]28.167[/C][C]-4.611[/C][C]-4.875[/C][C]-5.112[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=197985&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=197985&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

ANOVA Model
Response ~ Treatment_A * Treatment_B
means41.083-0.0830.753.14728.167-4.611-4.875-5.112







ANOVA Statistics
DfSum SqMean SqF valuePr(>F)
3
Treatment_A320.16.70.0630.979
Treatment_B311491.74111491.741107.8630
Treatment_A:Treatment_B385.44228.4810.2670.849
Residuals727670.917106.541

\begin{tabular}{lllllllll}
\hline
ANOVA Statistics \tabularnewline
  & Df & Sum Sq & Mean Sq & F value & Pr(>F) \tabularnewline
 & 3 &  &  &  &  \tabularnewline
Treatment_A & 3 & 20.1 & 6.7 & 0.063 & 0.979 \tabularnewline
Treatment_B & 3 & 11491.741 & 11491.741 & 107.863 & 0 \tabularnewline
Treatment_A:Treatment_B & 3 & 85.442 & 28.481 & 0.267 & 0.849 \tabularnewline
Residuals & 72 & 7670.917 & 106.541 &   &   \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=197985&T=2

[TABLE]
[ROW][C]ANOVA Statistics[/C][/ROW]
[ROW][C] [/C][C]Df[/C][C]Sum Sq[/C][C]Mean Sq[/C][C]F value[/C][C]Pr(>F)[/C][/ROW]
[ROW][C][/C][C]3[/C][C][/C][C][/C][C][/C][C][/C][/ROW]
[ROW][C]Treatment_A[/C][C]3[/C][C]20.1[/C][C]6.7[/C][C]0.063[/C][C]0.979[/C][/ROW]
[ROW][C]Treatment_B[/C][C]3[/C][C]11491.741[/C][C]11491.741[/C][C]107.863[/C][C]0[/C][/ROW]
[ROW][C]Treatment_A:Treatment_B[/C][C]3[/C][C]85.442[/C][C]28.481[/C][C]0.267[/C][C]0.849[/C][/ROW]
[ROW][C]Residuals[/C][C]72[/C][C]7670.917[/C][C]106.541[/C][C] [/C][C] [/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=197985&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=197985&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

ANOVA Statistics
DfSum SqMean SqF valuePr(>F)
3
Treatment_A320.16.70.0630.979
Treatment_B311491.74111491.741107.8630
Treatment_A:Treatment_B385.44228.4810.2670.849
Residuals727670.917106.541







Tukey Honest Significant Difference Comparisons
difflwruprp adj
F-E-0.75-9.3357.8350.996
I-E-1.2-9.7857.3850.983
S-E-0.05-8.6358.5351
I-F-0.45-9.0358.1350.999
S-F0.7-7.8859.2850.996
S-I1.15-7.4359.7350.985
Pos-Neg24.40119.70529.0970
F:Neg-E:Neg-0.083-13.53413.3671
I:Neg-E:Neg0.75-12.40513.9051
S:Neg-E:Neg3.147-9.75216.0470.995
E:Pos-E:Neg28.16713.45942.8740
F:Pos-E:Neg23.4729.26337.6810
I:Pos-E:Neg24.0429.33438.7490
S:Pos-E:Neg26.20210.87741.5270
I:Neg-F:Neg0.833-12.61714.2841
S:Neg-F:Neg3.231-9.9716.4320.994
E:Pos-F:Neg28.2513.27743.2230
F:Pos-F:Neg23.5569.07238.0390
I:Pos-F:Neg24.1259.15239.0980
S:Pos-F:Neg26.28610.70641.8650
S:Neg-I:Neg2.397-10.50215.2970.999
E:Pos-I:Neg27.41712.70942.1240
F:Pos-I:Neg22.7228.51336.9310
I:Pos-I:Neg23.2928.58437.9990
S:Pos-I:Neg25.45210.12740.7770
E:Pos-S:Neg25.01910.5439.4990
F:Pos-S:Neg20.3256.35234.2980.001
I:Pos-S:Neg20.8946.41535.3740.001
S:Pos-S:Neg23.0557.94938.1610
F:Pos-E:Pos-4.694-20.35210.9630.981
I:Pos-E:Pos-4.125-20.23611.9860.993
S:Pos-E:Pos-1.964-18.64114.7131
I:Pos-F:Pos0.569-15.08816.2271
S:Pos-F:Pos2.73-13.50918.9690.999
S:Pos-I:Pos2.161-14.51618.8381

\begin{tabular}{lllllllll}
\hline
Tukey Honest Significant Difference Comparisons \tabularnewline
  & diff & lwr & upr & p adj \tabularnewline
F-E & -0.75 & -9.335 & 7.835 & 0.996 \tabularnewline
I-E & -1.2 & -9.785 & 7.385 & 0.983 \tabularnewline
S-E & -0.05 & -8.635 & 8.535 & 1 \tabularnewline
I-F & -0.45 & -9.035 & 8.135 & 0.999 \tabularnewline
S-F & 0.7 & -7.885 & 9.285 & 0.996 \tabularnewline
S-I & 1.15 & -7.435 & 9.735 & 0.985 \tabularnewline
Pos-Neg & 24.401 & 19.705 & 29.097 & 0 \tabularnewline
F:Neg-E:Neg & -0.083 & -13.534 & 13.367 & 1 \tabularnewline
I:Neg-E:Neg & 0.75 & -12.405 & 13.905 & 1 \tabularnewline
S:Neg-E:Neg & 3.147 & -9.752 & 16.047 & 0.995 \tabularnewline
E:Pos-E:Neg & 28.167 & 13.459 & 42.874 & 0 \tabularnewline
F:Pos-E:Neg & 23.472 & 9.263 & 37.681 & 0 \tabularnewline
I:Pos-E:Neg & 24.042 & 9.334 & 38.749 & 0 \tabularnewline
S:Pos-E:Neg & 26.202 & 10.877 & 41.527 & 0 \tabularnewline
I:Neg-F:Neg & 0.833 & -12.617 & 14.284 & 1 \tabularnewline
S:Neg-F:Neg & 3.231 & -9.97 & 16.432 & 0.994 \tabularnewline
E:Pos-F:Neg & 28.25 & 13.277 & 43.223 & 0 \tabularnewline
F:Pos-F:Neg & 23.556 & 9.072 & 38.039 & 0 \tabularnewline
I:Pos-F:Neg & 24.125 & 9.152 & 39.098 & 0 \tabularnewline
S:Pos-F:Neg & 26.286 & 10.706 & 41.865 & 0 \tabularnewline
S:Neg-I:Neg & 2.397 & -10.502 & 15.297 & 0.999 \tabularnewline
E:Pos-I:Neg & 27.417 & 12.709 & 42.124 & 0 \tabularnewline
F:Pos-I:Neg & 22.722 & 8.513 & 36.931 & 0 \tabularnewline
I:Pos-I:Neg & 23.292 & 8.584 & 37.999 & 0 \tabularnewline
S:Pos-I:Neg & 25.452 & 10.127 & 40.777 & 0 \tabularnewline
E:Pos-S:Neg & 25.019 & 10.54 & 39.499 & 0 \tabularnewline
F:Pos-S:Neg & 20.325 & 6.352 & 34.298 & 0.001 \tabularnewline
I:Pos-S:Neg & 20.894 & 6.415 & 35.374 & 0.001 \tabularnewline
S:Pos-S:Neg & 23.055 & 7.949 & 38.161 & 0 \tabularnewline
F:Pos-E:Pos & -4.694 & -20.352 & 10.963 & 0.981 \tabularnewline
I:Pos-E:Pos & -4.125 & -20.236 & 11.986 & 0.993 \tabularnewline
S:Pos-E:Pos & -1.964 & -18.641 & 14.713 & 1 \tabularnewline
I:Pos-F:Pos & 0.569 & -15.088 & 16.227 & 1 \tabularnewline
S:Pos-F:Pos & 2.73 & -13.509 & 18.969 & 0.999 \tabularnewline
S:Pos-I:Pos & 2.161 & -14.516 & 18.838 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=197985&T=3

[TABLE]
[ROW][C]Tukey Honest Significant Difference Comparisons[/C][/ROW]
[ROW][C] [/C][C]diff[/C][C]lwr[/C][C]upr[/C][C]p adj[/C][/ROW]
[ROW][C]F-E[/C][C]-0.75[/C][C]-9.335[/C][C]7.835[/C][C]0.996[/C][/ROW]
[ROW][C]I-E[/C][C]-1.2[/C][C]-9.785[/C][C]7.385[/C][C]0.983[/C][/ROW]
[ROW][C]S-E[/C][C]-0.05[/C][C]-8.635[/C][C]8.535[/C][C]1[/C][/ROW]
[ROW][C]I-F[/C][C]-0.45[/C][C]-9.035[/C][C]8.135[/C][C]0.999[/C][/ROW]
[ROW][C]S-F[/C][C]0.7[/C][C]-7.885[/C][C]9.285[/C][C]0.996[/C][/ROW]
[ROW][C]S-I[/C][C]1.15[/C][C]-7.435[/C][C]9.735[/C][C]0.985[/C][/ROW]
[ROW][C]Pos-Neg[/C][C]24.401[/C][C]19.705[/C][C]29.097[/C][C]0[/C][/ROW]
[ROW][C]F:Neg-E:Neg[/C][C]-0.083[/C][C]-13.534[/C][C]13.367[/C][C]1[/C][/ROW]
[ROW][C]I:Neg-E:Neg[/C][C]0.75[/C][C]-12.405[/C][C]13.905[/C][C]1[/C][/ROW]
[ROW][C]S:Neg-E:Neg[/C][C]3.147[/C][C]-9.752[/C][C]16.047[/C][C]0.995[/C][/ROW]
[ROW][C]E:Pos-E:Neg[/C][C]28.167[/C][C]13.459[/C][C]42.874[/C][C]0[/C][/ROW]
[ROW][C]F:Pos-E:Neg[/C][C]23.472[/C][C]9.263[/C][C]37.681[/C][C]0[/C][/ROW]
[ROW][C]I:Pos-E:Neg[/C][C]24.042[/C][C]9.334[/C][C]38.749[/C][C]0[/C][/ROW]
[ROW][C]S:Pos-E:Neg[/C][C]26.202[/C][C]10.877[/C][C]41.527[/C][C]0[/C][/ROW]
[ROW][C]I:Neg-F:Neg[/C][C]0.833[/C][C]-12.617[/C][C]14.284[/C][C]1[/C][/ROW]
[ROW][C]S:Neg-F:Neg[/C][C]3.231[/C][C]-9.97[/C][C]16.432[/C][C]0.994[/C][/ROW]
[ROW][C]E:Pos-F:Neg[/C][C]28.25[/C][C]13.277[/C][C]43.223[/C][C]0[/C][/ROW]
[ROW][C]F:Pos-F:Neg[/C][C]23.556[/C][C]9.072[/C][C]38.039[/C][C]0[/C][/ROW]
[ROW][C]I:Pos-F:Neg[/C][C]24.125[/C][C]9.152[/C][C]39.098[/C][C]0[/C][/ROW]
[ROW][C]S:Pos-F:Neg[/C][C]26.286[/C][C]10.706[/C][C]41.865[/C][C]0[/C][/ROW]
[ROW][C]S:Neg-I:Neg[/C][C]2.397[/C][C]-10.502[/C][C]15.297[/C][C]0.999[/C][/ROW]
[ROW][C]E:Pos-I:Neg[/C][C]27.417[/C][C]12.709[/C][C]42.124[/C][C]0[/C][/ROW]
[ROW][C]F:Pos-I:Neg[/C][C]22.722[/C][C]8.513[/C][C]36.931[/C][C]0[/C][/ROW]
[ROW][C]I:Pos-I:Neg[/C][C]23.292[/C][C]8.584[/C][C]37.999[/C][C]0[/C][/ROW]
[ROW][C]S:Pos-I:Neg[/C][C]25.452[/C][C]10.127[/C][C]40.777[/C][C]0[/C][/ROW]
[ROW][C]E:Pos-S:Neg[/C][C]25.019[/C][C]10.54[/C][C]39.499[/C][C]0[/C][/ROW]
[ROW][C]F:Pos-S:Neg[/C][C]20.325[/C][C]6.352[/C][C]34.298[/C][C]0.001[/C][/ROW]
[ROW][C]I:Pos-S:Neg[/C][C]20.894[/C][C]6.415[/C][C]35.374[/C][C]0.001[/C][/ROW]
[ROW][C]S:Pos-S:Neg[/C][C]23.055[/C][C]7.949[/C][C]38.161[/C][C]0[/C][/ROW]
[ROW][C]F:Pos-E:Pos[/C][C]-4.694[/C][C]-20.352[/C][C]10.963[/C][C]0.981[/C][/ROW]
[ROW][C]I:Pos-E:Pos[/C][C]-4.125[/C][C]-20.236[/C][C]11.986[/C][C]0.993[/C][/ROW]
[ROW][C]S:Pos-E:Pos[/C][C]-1.964[/C][C]-18.641[/C][C]14.713[/C][C]1[/C][/ROW]
[ROW][C]I:Pos-F:Pos[/C][C]0.569[/C][C]-15.088[/C][C]16.227[/C][C]1[/C][/ROW]
[ROW][C]S:Pos-F:Pos[/C][C]2.73[/C][C]-13.509[/C][C]18.969[/C][C]0.999[/C][/ROW]
[ROW][C]S:Pos-I:Pos[/C][C]2.161[/C][C]-14.516[/C][C]18.838[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=197985&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=197985&T=3

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Tukey Honest Significant Difference Comparisons
difflwruprp adj
F-E-0.75-9.3357.8350.996
I-E-1.2-9.7857.3850.983
S-E-0.05-8.6358.5351
I-F-0.45-9.0358.1350.999
S-F0.7-7.8859.2850.996
S-I1.15-7.4359.7350.985
Pos-Neg24.40119.70529.0970
F:Neg-E:Neg-0.083-13.53413.3671
I:Neg-E:Neg0.75-12.40513.9051
S:Neg-E:Neg3.147-9.75216.0470.995
E:Pos-E:Neg28.16713.45942.8740
F:Pos-E:Neg23.4729.26337.6810
I:Pos-E:Neg24.0429.33438.7490
S:Pos-E:Neg26.20210.87741.5270
I:Neg-F:Neg0.833-12.61714.2841
S:Neg-F:Neg3.231-9.9716.4320.994
E:Pos-F:Neg28.2513.27743.2230
F:Pos-F:Neg23.5569.07238.0390
I:Pos-F:Neg24.1259.15239.0980
S:Pos-F:Neg26.28610.70641.8650
S:Neg-I:Neg2.397-10.50215.2970.999
E:Pos-I:Neg27.41712.70942.1240
F:Pos-I:Neg22.7228.51336.9310
I:Pos-I:Neg23.2928.58437.9990
S:Pos-I:Neg25.45210.12740.7770
E:Pos-S:Neg25.01910.5439.4990
F:Pos-S:Neg20.3256.35234.2980.001
I:Pos-S:Neg20.8946.41535.3740.001
S:Pos-S:Neg23.0557.94938.1610
F:Pos-E:Pos-4.694-20.35210.9630.981
I:Pos-E:Pos-4.125-20.23611.9860.993
S:Pos-E:Pos-1.964-18.64114.7131
I:Pos-F:Pos0.569-15.08816.2271
S:Pos-F:Pos2.73-13.50918.9690.999
S:Pos-I:Pos2.161-14.51618.8381







Levenes Test for Homogeneity of Variance
DfF valuePr(>F)
Group71.4320.206
72

\begin{tabular}{lllllllll}
\hline
Levenes Test for Homogeneity of Variance \tabularnewline
  & Df & F value & Pr(>F) \tabularnewline
Group & 7 & 1.432 & 0.206 \tabularnewline
  & 72 &   &   \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=197985&T=4

[TABLE]
[ROW][C]Levenes Test for Homogeneity of Variance[/C][/ROW]
[ROW][C] [/C][C]Df[/C][C]F value[/C][C]Pr(>F)[/C][/ROW]
[ROW][C]Group[/C][C]7[/C][C]1.432[/C][C]0.206[/C][/ROW]
[ROW][C] [/C][C]72[/C][C] [/C][C] [/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=197985&T=4

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=197985&T=4

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Levenes Test for Homogeneity of Variance
DfF valuePr(>F)
Group71.4320.206
72



Parameters (Session):
par1 = 1 ; par2 = 2 ; par3 = TRUE ;
Parameters (R input):
par1 = 1 ; par2 = 2 ; par3 = 4 ; par4 = TRUE ;
R code (references can be found in the software module):
par4 <- 'FALSE'
par3 <- '4'
par2 <- '2'
par1 <- '1'
cat1 <- as.numeric(par1) #
cat2<- as.numeric(par2) #
cat3 <- as.numeric(par3)
intercept<-as.logical(par4)
x <- t(x)
x1<-as.numeric(x[,cat1])
f1<-as.character(x[,cat2])
f2 <- as.character(x[,cat3])
xdf<-data.frame(x1,f1, f2)
(V1<-dimnames(y)[[1]][cat1])
(V2<-dimnames(y)[[1]][cat2])
(V3 <-dimnames(y)[[1]][cat3])
names(xdf)<-c('Response', 'Treatment_A', 'Treatment_B')
if(intercept == FALSE) (lmxdf<-lm(Response ~ Treatment_A * Treatment_B- 1, data = xdf) ) else (lmxdf<-lm(Response ~ Treatment_A * Treatment_B, data = xdf) )
(aov.xdf<-aov(lmxdf) )
(anova.xdf<-anova(lmxdf) )
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'ANOVA Model', length(lmxdf$coefficients)+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, lmxdf$call['formula'],length(lmxdf$coefficients)+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'means',,TRUE)
for(i in 1:length(lmxdf$coefficients)){
a<-table.element(a, round(lmxdf$coefficients[i], digits=3),,FALSE)
}
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'ANOVA Statistics', 5+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, ' ',,TRUE)
a<-table.element(a, 'Df',,FALSE)
a<-table.element(a, 'Sum Sq',,FALSE)
a<-table.element(a, 'Mean Sq',,FALSE)
a<-table.element(a, 'F value',,FALSE)
a<-table.element(a, 'Pr(>F)',,FALSE)
a<-table.row.end(a)
for(i in 1 : length(rownames(anova.xdf))-1){
a<-table.row.start(a)
a<-table.element(a,rownames(anova.xdf)[i] ,,TRUE)
a<-table.element(a, anova.xdf$Df[1],,FALSE)
a<-table.element(a, round(anova.xdf$'Sum Sq'[i], digits=3),,FALSE)
a<-table.element(a, round(anova.xdf$'Mean Sq'[i], digits=3),,FALSE)
a<-table.element(a, round(anova.xdf$'F value'[i], digits=3),,FALSE)
a<-table.element(a, round(anova.xdf$'Pr(>F)'[i], digits=3),,FALSE)
a<-table.row.end(a)
}
a<-table.row.start(a)
a<-table.element(a, 'Residuals',,TRUE)
a<-table.element(a, anova.xdf$'Df'[i+1],,FALSE)
a<-table.element(a, round(anova.xdf$'Sum Sq'[i+1], digits=3),,FALSE)
a<-table.element(a, round(anova.xdf$'Mean Sq'[i+1], digits=3),,FALSE)
a<-table.element(a, ' ',,FALSE)
a<-table.element(a, ' ',,FALSE)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
bitmap(file='anovaplot.png')
boxplot(Response ~ Treatment_A + Treatment_B, data=xdf, xlab=V2, ylab=V1, main='Boxplots of ANOVA Groups')
dev.off()
bitmap(file='designplot.png')
xdf2 <- xdf # to preserve xdf make copy for function
names(xdf2) <- c(V1, V2, V3)
plot.design(xdf2, main='Design Plot of Group Means')
dev.off()
bitmap(file='interactionplot.png')
interaction.plot(xdf$Treatment_A, xdf$Treatment_B, xdf$Response, xlab=V2, ylab=V1, trace.label=V3, main='Possible Interactions Between Anova Groups')
dev.off()
if(intercept==TRUE){
thsd<-TukeyHSD(aov.xdf)
names(thsd) <- c(V2, V3, paste(V2, ':', V3, sep=''))
bitmap(file='TukeyHSDPlot.png')
layout(matrix(c(1,2,3,3), 2,2))
plot(thsd, las=1)
dev.off()
}
if(intercept==TRUE){
ntables<-length(names(thsd))
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Tukey Honest Significant Difference Comparisons', 5,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, ' ', 1, TRUE)
for(i in 1:4){
a<-table.element(a,colnames(thsd[[1]])[i], 1, TRUE)
}
a<-table.row.end(a)
for(nt in 1:ntables){
for(i in 1:length(rownames(thsd[[nt]]))){
a<-table.row.start(a)
a<-table.element(a,rownames(thsd[[nt]])[i], 1, TRUE)
for(j in 1:4){
a<-table.element(a,round(thsd[[nt]][i,j], digits=3), 1, FALSE)
}
a<-table.row.end(a)
}
} # end nt
a<-table.end(a)
table.save(a,file='hsdtable.tab')
}#end if hsd tables
if(intercept==FALSE){
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'TukeyHSD Message', 1,TRUE)
a<-table.row.end(a)
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Must Include Intercept to use Tukey Test ', 1, FALSE)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable2.tab')
}
library(car)
lt.lmxdf<-levene.test(lmxdf)
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Levenes Test for Homogeneity of Variance', 4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,' ', 1, TRUE)
for (i in 1:3){
a<-table.element(a,names(lt.lmxdf)[i], 1, FALSE)
}
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Group', 1, TRUE)
for (i in 1:3){
a<-table.element(a,round(lt.lmxdf[[i]][1], digits=3), 1, FALSE)
}
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,' ', 1, TRUE)
a<-table.element(a,lt.lmxdf[[1]][2], 1, FALSE)
a<-table.element(a,' ', 1, FALSE)
a<-table.element(a,' ', 1, FALSE)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')