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 computationTue, 06 Dec 2011 08:27:46 -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/2011/Dec/06/t1323178082pv9u2zpimgygyh5.htm/, Retrieved Sun, 28 Apr 2024 22:52:43 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=151556, Retrieved Sun, 28 Apr 2024 22:52:43 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact102
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Variability] [Two-Way ANOVA] [2010-11-30 21:42:30] [74be16979710d4c4e7c6647856088456]
- RM    [Two-Way ANOVA] [Two-Way ANOVA - C...] [2011-11-28 17:22:56] [98fd0e87c3eb04e0cc2efde01dbafab6]
- RMP     [Histogram, QQplot and Density] [] [2011-12-06 13:04:33] [e5cd290daa2365fa501ea04dbf3bfa28]
- RMPD        [Two-Way ANOVA] [] [2011-12-06 13:27:46] [898f528db62d66cb4fd17f9b6ea3eb9d] [Current]
Feedback Forum

Post a new message
Dataseries X:
'GOOD'	'HIGH'	25
'GOOD'	'HIGH'	0
'GOOD'	'HIGH'	-16
'GOOD'	'HIGH'	5
'GOOD'	'HIGH'	11
'GOOD'	'HIGH'	-6
'GOOD'	'HIGH'	42
'GOOD'	'HIGH'	-2
'GOOD'	'HIGH'	-13
'GOOD'	'HIGH'	14
'GOOD'	'HIGH'	4
'GOOD'	'HIGH'	-22
'GOOD'	'HIGH'	19
'GOOD'	'HIGH'	6
'GOOD'	'HIGH'	-6
'GOOD'	'LOW'	-25
'GOOD'	'LOW'	-23
'GOOD'	'LOW'	-28
'GOOD'	'LOW'	-22
'GOOD'	'LOW'	-22
'GOOD'	'LOW'	-10
'GOOD'	'LOW'	-20
'GOOD'	'LOW'	-24
'GOOD'	'LOW'	-24
'GOOD'	'LOW'	-22
'GOOD'	'LOW'	-23
'GOOD'	'LOW'	-19
'GOOD'	'LOW'	-2
'GOOD'	'LOW'	12
'GOOD'	'LOW'	-8
'GOOD'	'LOW'	-17
'GOOD'	'LOW'	-30
'SCIENTIFIC'	'HIGH'	-19
'SCIENTIFIC'	'HIGH'	-24
'SCIENTIFIC'	'HIGH'	-4
'SCIENTIFIC'	'HIGH'	-24
'SCIENTIFIC'	'HIGH'	0
'SCIENTIFIC'	'HIGH'	-4
'SCIENTIFIC'	'HIGH'	5
'SCIENTIFIC'	'HIGH'	-1
'SCIENTIFIC'	'HIGH'	-9
'SCIENTIFIC'	'HIGH'	-5
'SCIENTIFIC'	'HIGH'	-6
'SCIENTIFIC'	'HIGH'	4
'SCIENTIFIC'	'HIGH'	-13
'SCIENTIFIC'	'HIGH'	-1
'SCIENTIFIC'	'HIGH'	-3
'SCIENTIFIC'	'HIGH'	-11
'SCIENTIFIC'	'HIGH'	-6
'SCIENTIFIC'	'HIGH'	-4
'SCIENTIFIC'	'LOW'	6
'SCIENTIFIC'	'LOW'	-5
'SCIENTIFIC'	'LOW'	14
'SCIENTIFIC'	'LOW'	-11
'SCIENTIFIC'	'LOW'	14
'SCIENTIFIC'	'LOW'	-5
'SCIENTIFIC'	'LOW'	-22
'SCIENTIFIC'	'LOW'	7
'SCIENTIFIC'	'LOW'	14
'SCIENTIFIC'	'LOW'	15
'SCIENTIFIC'	'LOW'	-6
'SCIENTIFIC'	'LOW'	9
'SCIENTIFIC'	'LOW'	-5
'NONE'	'HIGH'	-26
'NONE'	'HIGH'	-1
'NONE'	'HIGH'	22
'NONE'	'HIGH'	3
'NONE'	'HIGH'	-26
'NONE'	'HIGH'	4
'NONE'	'HIGH'	-21
'NONE'	'HIGH'	-19
'NONE'	'HIGH'	-12
'NONE'	'HIGH'	9
'NONE'	'HIGH'	-9
'NONE'	'HIGH'	-27
'NONE'	'HIGH'	-10
'NONE'	'HIGH'	-37
'NONE'	'HIGH'	0
'NONE'	'HIGH'	-10
'NONE'	'LOW'	-12
'NONE'	'LOW'	-4
'NONE'	'LOW'	13
'NONE'	'LOW'	-27
'NONE'	'LOW'	-7
'NONE'	'LOW'	-20
'NONE'	'LOW'	-4
'NONE'	'LOW'	-10
'NONE'	'LOW'	-3
'NONE'	'LOW'	-11
'NONE'	'LOW'	2
'NONE'	'LOW'	-9
'NONE'	'LOW'	20
'NONE'	'LOW'	9
'NONE'	'LOW'	-8
'NONE'	'LOW'	8
'NONE'	'LOW'	-6
'NONE'	'LOW'	6




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Herman Ole Andreas Wold' @ wold.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 & 2 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151556&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151556&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151556&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 time2 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net







ANOVA Model
xdf2$R ~ xdf2$Inst * xdf2$Exp
names(Intercept)xdf2$InstNONExdf2$InstSCIENTIFICxdf2$ExpLOWxdf2$InstNONE:xdf2$ExpLOWxdf2$InstSCIENTIFIC:xdf2$ExpLOW
means4.0667-14.067-11.011-22.12528.62530.993

\begin{tabular}{lllllllll}
\hline
ANOVA Model \tabularnewline
xdf2$R ~ xdf2$Inst * xdf2$Exp \tabularnewline
names & (Intercept) & xdf2$InstNONE & xdf2$InstSCIENTIFIC & xdf2$ExpLOW & xdf2$InstNONE:xdf2$ExpLOW & xdf2$InstSCIENTIFIC:xdf2$ExpLOW \tabularnewline
means & 4.0667 & -14.067 & -11.011 & -22.125 & 28.625 & 30.993 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151556&T=1

[TABLE]
[ROW][C]ANOVA Model[/C][/ROW]
[ROW][C]xdf2$R ~ xdf2$Inst * xdf2$Exp[/C][/ROW]
[ROW][C]names[/C][C](Intercept)[/C][C]xdf2$InstNONE[/C][C]xdf2$InstSCIENTIFIC[/C][C]xdf2$ExpLOW[/C][C]xdf2$InstNONE:xdf2$ExpLOW[/C][C]xdf2$InstSCIENTIFIC:xdf2$ExpLOW[/C][/ROW]
[ROW][C]means[/C][C]4.0667[/C][C]-14.067[/C][C]-11.011[/C][C]-22.125[/C][C]28.625[/C][C]30.993[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151556&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151556&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
xdf2$R ~ xdf2$Inst * xdf2$Exp
names(Intercept)xdf2$InstNONExdf2$InstSCIENTIFICxdf2$ExpLOWxdf2$InstNONE:xdf2$ExpLOWxdf2$InstSCIENTIFIC:xdf2$ExpLOW
means4.0667-14.067-11.011-22.12528.62530.993







ANOVA Statistics
DfSum SqMean SqF valuePr(>F)
2
xdf2$Inst2338.58169.291.06270.34976
xdf2$Exp21231230.772120.38187
xdf2$Inst:xdf2$Exp24729.42364.714.8442.6333e-06
Residuals9114496159.3

\begin{tabular}{lllllllll}
\hline
ANOVA Statistics \tabularnewline
  & Df & Sum Sq & Mean Sq & F value & Pr(>F) \tabularnewline
 & 2 &  &  &  &  \tabularnewline
xdf2$Inst & 2 & 338.58 & 169.29 & 1.0627 & 0.34976 \tabularnewline
xdf2$Exp & 2 & 123 & 123 & 0.77212 & 0.38187 \tabularnewline
xdf2$Inst:xdf2$Exp & 2 & 4729.4 & 2364.7 & 14.844 & 2.6333e-06 \tabularnewline
Residuals & 91 & 14496 & 159.3 &   &   \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151556&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]2[/C][C][/C][C][/C][C][/C][C][/C][/ROW]
[ROW][C]xdf2$Inst[/C][C]2[/C][C]338.58[/C][C]169.29[/C][C]1.0627[/C][C]0.34976[/C][/ROW]
[ROW][C]xdf2$Exp[/C][C]2[/C][C]123[/C][C]123[/C][C]0.77212[/C][C]0.38187[/C][/ROW]
[ROW][C]xdf2$Inst:xdf2$Exp[/C][C]2[/C][C]4729.4[/C][C]2364.7[/C][C]14.844[/C][C]2.6333e-06[/C][/ROW]
[ROW][C]Residuals[/C][C]91[/C][C]14496[/C][C]159.3[/C][C] [/C][C] [/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151556&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151556&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)
2
xdf2$Inst2338.58169.291.06270.34976
xdf2$Exp21231230.772120.38187
xdf2$Inst:xdf2$Exp24729.42364.714.8442.6333e-06
Residuals9114496159.3







Tukey Honest Significant Difference Comparisons
difflwruprp adj
NONE-GOOD1.1287-6.27818.53540.92997
SCIENTIFIC-GOOD4.4617-3.116812.040.34376
SCIENTIFIC-NONE3.333-4.13510.8010.53915
LOW-HIGH-2.2402-7.33152.85120.38443
NONE:HIGH-GOOD:HIGH-14.067-27.273-0.860560.029905
SCIENTIFIC:HIGH-GOOD:HIGH-11.011-23.8571.83510.13631
GOOD:LOW-GOOD:HIGH-22.125-35.142-9.10874.9302e-05
NONE:LOW-GOOD:HIGH-7.5667-20.4135.27950.52572
SCIENTIFIC:LOW-GOOD:HIGH-2.1436-16.06811.780.99765
SCIENTIFIC:HIGH-NONE:HIGH3.0556-9.569815.6810.98095
GOOD:LOW-NONE:HIGH-8.0588-20.8584.74010.45003
NONE:LOW-NONE:HIGH6.5-6.125319.1250.66586
SCIENTIFIC:LOW-NONE:HIGH11.923-1.797325.6430.1263
GOOD:LOW-SCIENTIFIC:HIGH-11.114-23.5421.31280.10681
NONE:LOW-SCIENTIFIC:HIGH3.4444-8.803915.6930.96337
SCIENTIFIC:LOW-SCIENTIFIC:HIGH8.8675-4.506822.2420.39073
NONE:LOW-GOOD:LOW14.5592.131626.9860.012069
SCIENTIFIC:LOW-GOOD:LOW19.9826.443633.520.00060348
SCIENTIFIC:LOW-NONE:LOW5.4231-7.951318.7970.84501

\begin{tabular}{lllllllll}
\hline
Tukey Honest Significant Difference Comparisons \tabularnewline
  & diff & lwr & upr & p adj \tabularnewline
NONE-GOOD & 1.1287 & -6.2781 & 8.5354 & 0.92997 \tabularnewline
SCIENTIFIC-GOOD & 4.4617 & -3.1168 & 12.04 & 0.34376 \tabularnewline
SCIENTIFIC-NONE & 3.333 & -4.135 & 10.801 & 0.53915 \tabularnewline
LOW-HIGH & -2.2402 & -7.3315 & 2.8512 & 0.38443 \tabularnewline
NONE:HIGH-GOOD:HIGH & -14.067 & -27.273 & -0.86056 & 0.029905 \tabularnewline
SCIENTIFIC:HIGH-GOOD:HIGH & -11.011 & -23.857 & 1.8351 & 0.13631 \tabularnewline
GOOD:LOW-GOOD:HIGH & -22.125 & -35.142 & -9.1087 & 4.9302e-05 \tabularnewline
NONE:LOW-GOOD:HIGH & -7.5667 & -20.413 & 5.2795 & 0.52572 \tabularnewline
SCIENTIFIC:LOW-GOOD:HIGH & -2.1436 & -16.068 & 11.78 & 0.99765 \tabularnewline
SCIENTIFIC:HIGH-NONE:HIGH & 3.0556 & -9.5698 & 15.681 & 0.98095 \tabularnewline
GOOD:LOW-NONE:HIGH & -8.0588 & -20.858 & 4.7401 & 0.45003 \tabularnewline
NONE:LOW-NONE:HIGH & 6.5 & -6.1253 & 19.125 & 0.66586 \tabularnewline
SCIENTIFIC:LOW-NONE:HIGH & 11.923 & -1.7973 & 25.643 & 0.1263 \tabularnewline
GOOD:LOW-SCIENTIFIC:HIGH & -11.114 & -23.542 & 1.3128 & 0.10681 \tabularnewline
NONE:LOW-SCIENTIFIC:HIGH & 3.4444 & -8.8039 & 15.693 & 0.96337 \tabularnewline
SCIENTIFIC:LOW-SCIENTIFIC:HIGH & 8.8675 & -4.5068 & 22.242 & 0.39073 \tabularnewline
NONE:LOW-GOOD:LOW & 14.559 & 2.1316 & 26.986 & 0.012069 \tabularnewline
SCIENTIFIC:LOW-GOOD:LOW & 19.982 & 6.4436 & 33.52 & 0.00060348 \tabularnewline
SCIENTIFIC:LOW-NONE:LOW & 5.4231 & -7.9513 & 18.797 & 0.84501 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151556&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]NONE-GOOD[/C][C]1.1287[/C][C]-6.2781[/C][C]8.5354[/C][C]0.92997[/C][/ROW]
[ROW][C]SCIENTIFIC-GOOD[/C][C]4.4617[/C][C]-3.1168[/C][C]12.04[/C][C]0.34376[/C][/ROW]
[ROW][C]SCIENTIFIC-NONE[/C][C]3.333[/C][C]-4.135[/C][C]10.801[/C][C]0.53915[/C][/ROW]
[ROW][C]LOW-HIGH[/C][C]-2.2402[/C][C]-7.3315[/C][C]2.8512[/C][C]0.38443[/C][/ROW]
[ROW][C]NONE:HIGH-GOOD:HIGH[/C][C]-14.067[/C][C]-27.273[/C][C]-0.86056[/C][C]0.029905[/C][/ROW]
[ROW][C]SCIENTIFIC:HIGH-GOOD:HIGH[/C][C]-11.011[/C][C]-23.857[/C][C]1.8351[/C][C]0.13631[/C][/ROW]
[ROW][C]GOOD:LOW-GOOD:HIGH[/C][C]-22.125[/C][C]-35.142[/C][C]-9.1087[/C][C]4.9302e-05[/C][/ROW]
[ROW][C]NONE:LOW-GOOD:HIGH[/C][C]-7.5667[/C][C]-20.413[/C][C]5.2795[/C][C]0.52572[/C][/ROW]
[ROW][C]SCIENTIFIC:LOW-GOOD:HIGH[/C][C]-2.1436[/C][C]-16.068[/C][C]11.78[/C][C]0.99765[/C][/ROW]
[ROW][C]SCIENTIFIC:HIGH-NONE:HIGH[/C][C]3.0556[/C][C]-9.5698[/C][C]15.681[/C][C]0.98095[/C][/ROW]
[ROW][C]GOOD:LOW-NONE:HIGH[/C][C]-8.0588[/C][C]-20.858[/C][C]4.7401[/C][C]0.45003[/C][/ROW]
[ROW][C]NONE:LOW-NONE:HIGH[/C][C]6.5[/C][C]-6.1253[/C][C]19.125[/C][C]0.66586[/C][/ROW]
[ROW][C]SCIENTIFIC:LOW-NONE:HIGH[/C][C]11.923[/C][C]-1.7973[/C][C]25.643[/C][C]0.1263[/C][/ROW]
[ROW][C]GOOD:LOW-SCIENTIFIC:HIGH[/C][C]-11.114[/C][C]-23.542[/C][C]1.3128[/C][C]0.10681[/C][/ROW]
[ROW][C]NONE:LOW-SCIENTIFIC:HIGH[/C][C]3.4444[/C][C]-8.8039[/C][C]15.693[/C][C]0.96337[/C][/ROW]
[ROW][C]SCIENTIFIC:LOW-SCIENTIFIC:HIGH[/C][C]8.8675[/C][C]-4.5068[/C][C]22.242[/C][C]0.39073[/C][/ROW]
[ROW][C]NONE:LOW-GOOD:LOW[/C][C]14.559[/C][C]2.1316[/C][C]26.986[/C][C]0.012069[/C][/ROW]
[ROW][C]SCIENTIFIC:LOW-GOOD:LOW[/C][C]19.982[/C][C]6.4436[/C][C]33.52[/C][C]0.00060348[/C][/ROW]
[ROW][C]SCIENTIFIC:LOW-NONE:LOW[/C][C]5.4231[/C][C]-7.9513[/C][C]18.797[/C][C]0.84501[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151556&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151556&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
NONE-GOOD1.1287-6.27818.53540.92997
SCIENTIFIC-GOOD4.4617-3.116812.040.34376
SCIENTIFIC-NONE3.333-4.13510.8010.53915
LOW-HIGH-2.2402-7.33152.85120.38443
NONE:HIGH-GOOD:HIGH-14.067-27.273-0.860560.029905
SCIENTIFIC:HIGH-GOOD:HIGH-11.011-23.8571.83510.13631
GOOD:LOW-GOOD:HIGH-22.125-35.142-9.10874.9302e-05
NONE:LOW-GOOD:HIGH-7.5667-20.4135.27950.52572
SCIENTIFIC:LOW-GOOD:HIGH-2.1436-16.06811.780.99765
SCIENTIFIC:HIGH-NONE:HIGH3.0556-9.569815.6810.98095
GOOD:LOW-NONE:HIGH-8.0588-20.8584.74010.45003
NONE:LOW-NONE:HIGH6.5-6.125319.1250.66586
SCIENTIFIC:LOW-NONE:HIGH11.923-1.797325.6430.1263
GOOD:LOW-SCIENTIFIC:HIGH-11.114-23.5421.31280.10681
NONE:LOW-SCIENTIFIC:HIGH3.4444-8.803915.6930.96337
SCIENTIFIC:LOW-SCIENTIFIC:HIGH8.8675-4.506822.2420.39073
NONE:LOW-GOOD:LOW14.5592.131626.9860.012069
SCIENTIFIC:LOW-GOOD:LOW19.9826.443633.520.00060348
SCIENTIFIC:LOW-NONE:LOW5.4231-7.951318.7970.84501







Levenes Test for Homogeneity of Variance
DfF valuePr(>F)
Group51.73080.13546
91

\begin{tabular}{lllllllll}
\hline
Levenes Test for Homogeneity of Variance \tabularnewline
  & Df & F value & Pr(>F) \tabularnewline
Group & 5 & 1.7308 & 0.13546 \tabularnewline
  & 91 &   &   \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151556&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]5[/C][C]1.7308[/C][C]0.13546[/C][/ROW]
[ROW][C] [/C][C]91[/C][C] [/C][C] [/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151556&T=4

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



Parameters (Session):
par1 = 3 ; par2 = 1 ; par3 = 2 ; par4 = TRUE ;
Parameters (R input):
par1 = 3 ; par2 = 1 ; par3 = 2 ; par4 = TRUE ;
R code (references can be found in the software module):
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])
mynames<- c(V1, V2, V3)
xdf2<-xdf
names(xdf2)<-mynames
names(xdf)<-c('R', 'A', 'B')
mynames <- c(V1, V2, V3)
if(intercept == FALSE)eval (substitute(lmout<-lm(xdf$R ~ xdf$A * xdf$B- 1, data = xdf), list(xdf=quote(xdf2),R=mynames[1],A=mynames[2],B=mynames[3]) ))else eval(substitute(lmout<-lm(xdf$R ~ xdf$A * xdf$B, data = xdf), list(xdf=quote(xdf2),R=mynames[1],A=mynames[2],B=mynames[3]) ))
oldnames<-names(lmout$coeff)
newnames<-gsub('xdf2$', '', oldnames)
(names(lmout$coeff)<-newnames)
(names(lmout$coefficients)<-newnames)
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'ANOVA Model', length(lmout$coefficients)+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
callstr<-gsub('xdf2$', '',as.character(lmout$call$formula))
callstr<-paste(callstr[2], callstr[1], callstr[3])
a<-table.element(a,callstr ,length(lmout$coefficients)+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'names',,TRUE)
for(i in 1:length(lmout$coefficients)){
a<-table.element(a, names(lmout$coefficients[i]),,FALSE)
}
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'means',,TRUE)
for(i in 1:length(lmout$coefficients)){
a<-table.element(a, signif(lmout$coefficients[i], digits=5),,FALSE)
}
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable.tab')
(aov.xdf<-aov(lmout) )
(anova.xdf<-anova(lmout) )
rownames(anova.xdf)<-gsub('xdf2$','',rownames(anova.xdf))
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, signif(anova.xdf$'Sum Sq'[i], digits=5),,FALSE)
a<-table.element(a, signif(anova.xdf$'Mean Sq'[i], digits=5),,FALSE)
a<-table.element(a, signif(anova.xdf$'F value'[i], digits=5),,FALSE)
a<-table.element(a, signif(anova.xdf$'Pr(>F)'[i], digits=5),,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, signif(anova.xdf$'Sum Sq'[i+1], digits=5),,FALSE)
a<-table.element(a, signif(anova.xdf$'Mean Sq'[i+1], digits=5),,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(R ~ A + 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$A, xdf$B, xdf$R, 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(0,0,1,2,1,2,0,0,3,3,3,3), 2,6))
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,signif(thsd[[nt]][i,j], digits=5), 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(lmout)
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,signif(lt.lmxdf[[i]][1], digits=5), 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')