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 computationFri, 23 Dec 2011 08:48:57 -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/23/t13246481607krxekbxbw18p2i.htm/, Retrieved Mon, 29 Apr 2024 23:19:56 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=160409, Retrieved Mon, 29 Apr 2024 23:19:56 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact79
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 - 2way-anova] [2011-12-23 13:48:57] [e598b5cd83fcb010b35e92a01f5e81e9] [Current]
Feedback Forum

Post a new message
Dataseries X:
1	1	'T'	0	0
1	1	'T'	0	1
0	1	'T'	1	1
0	0	'T'	0	1
1	1	'T'	0	0
1	1	'T'	0	1
1	1	'T'	0	0
0	1	'T'	1	0
0	1	'T'	1	1
1	1	'T'	0	1
0	0	'T'	0	0
0	1	'T'	1	0
0	1	'T'	1	1
0	1	'T'	1	1
0	0	'T'	0	0
1	1	'T'	0	1
1	1	'T'	0	0
1	1	'T'	0	1
0	1	'T'	1	1
0	0	'T'	0	1
1	1	'T'	0	1
1	1	'T'	0	0
0	0	'T'	0	1
1	0	'T'	-1	1
1	1	'T'	0	0
1	0	'T'	-1	1
1	1	'T'	0	0
0	0	'T'	0	1
0	0	'T'	0	1
1	1	'T'	0	1
1	0	'T'	-1	1
1	1	'T'	0	1
0	0	'T'	0	0
0	0	'T'	0	0
0	0	'T'	0	0
1	1	'T'	0	1
1	1	'T'	0	1
0	1	'E'	1	1
0	1	'E'	1	0
1	1	'E'	0	0
1	1	'E'	0	1
1	1	'E'	0	0
1	1	'E'	0	1
1	1	'E'	0	1
0	0	'E'	0	1
0	1	'E'	1	1
0	1	'E'	1	0
1	1	'E'	0	0
1	1	'E'	0	0
0	0	'E'	0	1
0	1	'E'	1	1
1	1	'E'	0	1
0	1	'E'	1	1
0	0	'E'	0	1
0	1	'E'	1	1
0	1	'E'	1	0
0	1	'E'	1	0
0	1	'E'	1	1
0	0	'E'	0	1
0	0	'E'	0	1
0	1	'E'	1	0
1	1	'E'	0	0
1	1	'E'	0	0
1	0	'E'	-1	1
0	0	'E'	0	1
0	1	'E'	1	0
0	1	'E'	1	1
0	0	'E'	0	0
1	1	'E'	0	1
1	1	'E'	0	0
0	1	'S'	1	1
0	1	'S'	1	0
0	1	'S'	1	1
0	1	'S'	1	1
1	1	'S'	0	0
1	0	'S'	-1	1
0	0	'S'	0	1
1	1	'S'	0	0
1	0	'S'	-1	1
1	1	'S'	0	0
0	0	'S'	0	0
0	0	'S'	0	0
0	0	'S'	0	1
1	0	'S'	-1	1
0	0	'S'	0	0
0	0	'S'	0	1
1	0	'S'	-1	1
1	1	'S'	0	0
0	0	'S'	0	1
0	0	'S'	0	1
1	1	'S'	0	1
1	1	'S'	0	1
1	1	'S'	0	0
0	1	'S'	1	0
1	1	'S'	0	1
1	1	'S'	0	0
1	1	'S'	0	0
1	1	'S'	0	1
0	0	'S'	0	1
0	0	'S'	0	1
1	1	'S'	0	0
0	0	'S'	0	1
0	0	'S'	0	0
0	0	'S'	0	0
0	1	'S'	1	1




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

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







ANOVA Model
xdf2$diff1 ~ xdf2$treat * xdf2$gender
names(Intercept)xdf2$treatSxdf2$treatTxdf2$gender1xdf2$treatS:xdf2$gender1xdf2$treatT:xdf2$gender1
means0.42857-0.29524-0.28571-0.11278-0.0205510.056881

\begin{tabular}{lllllllll}
\hline
ANOVA Model \tabularnewline
xdf2$diff1 ~ xdf2$treat * xdf2$gender \tabularnewline
names & (Intercept) & xdf2$treatS & xdf2$treatT & xdf2$gender1 & xdf2$treatS:xdf2$gender1 & xdf2$treatT:xdf2$gender1 \tabularnewline
means & 0.42857 & -0.29524 & -0.28571 & -0.11278 & -0.020551 & 0.056881 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160409&T=1

[TABLE]
[ROW][C]ANOVA Model[/C][/ROW]
[ROW][C]xdf2$diff1 ~ xdf2$treat * xdf2$gender[/C][/ROW]
[ROW][C]names[/C][C](Intercept)[/C][C]xdf2$treatS[/C][C]xdf2$treatT[/C][C]xdf2$gender1[/C][C]xdf2$treatS:xdf2$gender1[/C][C]xdf2$treatT:xdf2$gender1[/C][/ROW]
[ROW][C]means[/C][C]0.42857[/C][C]-0.29524[/C][C]-0.28571[/C][C]-0.11278[/C][C]-0.020551[/C][C]0.056881[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160409&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160409&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$diff1 ~ xdf2$treat * xdf2$gender
names(Intercept)xdf2$treatSxdf2$treatTxdf2$gender1xdf2$treatS:xdf2$gender1xdf2$treatT:xdf2$gender1
means0.42857-0.29524-0.28571-0.11278-0.0205510.056881







ANOVA Statistics
DfSum SqMean SqF valuePr(>F)
2
xdf2$treat21.82460.912323.13530.047835
xdf2$gender20.254340.254340.874070.35211
xdf2$treat:xdf2$gender20.0277640.0138820.0477080.95343
Residuals9928.8080.29099

\begin{tabular}{lllllllll}
\hline
ANOVA Statistics \tabularnewline
  & Df & Sum Sq & Mean Sq & F value & Pr(>F) \tabularnewline
 & 2 &  &  &  &  \tabularnewline
xdf2$treat & 2 & 1.8246 & 0.91232 & 3.1353 & 0.047835 \tabularnewline
xdf2$gender & 2 & 0.25434 & 0.25434 & 0.87407 & 0.35211 \tabularnewline
xdf2$treat:xdf2$gender & 2 & 0.027764 & 0.013882 & 0.047708 & 0.95343 \tabularnewline
Residuals & 99 & 28.808 & 0.29099 &   &   \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160409&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$treat[/C][C]2[/C][C]1.8246[/C][C]0.91232[/C][C]3.1353[/C][C]0.047835[/C][/ROW]
[ROW][C]xdf2$gender[/C][C]2[/C][C]0.25434[/C][C]0.25434[/C][C]0.87407[/C][C]0.35211[/C][/ROW]
[ROW][C]xdf2$treat:xdf2$gender[/C][C]2[/C][C]0.027764[/C][C]0.013882[/C][C]0.047708[/C][C]0.95343[/C][/ROW]
[ROW][C]Residuals[/C][C]99[/C][C]28.808[/C][C]0.29099[/C][C] [/C][C] [/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160409&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160409&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$treat21.82460.912323.13530.047835
xdf2$gender20.254340.254340.874070.35211
xdf2$treat:xdf2$gender20.0277640.0138820.0477080.95343
Residuals9928.8080.29099







Tukey Honest Significant Difference Comparisons
difflwruprp adj
S-E-0.30649-0.617940.00495050.054759
T-E-0.25553-0.562860.0518040.12291
T-S0.050965-0.251690.353620.91539
1-0-0.099976-0.312390.112440.35263
S:0-E:0-0.29524-0.877830.287350.68223
T:0-E:0-0.28571-0.878270.306840.72613
E:1-E:0-0.11278-0.664980.439410.99125
S:1-E:0-0.42857-0.974880.117730.21214
T:1-E:0-0.34161-0.873050.189820.42774
T:0-S:00.0095238-0.573070.592121
E:1-S:00.18246-0.359040.723950.9235
S:1-S:0-0.13333-0.668820.402150.97861
T:1-S:0-0.046377-0.566680.473930.99984
E:1-T:00.17293-0.379260.725130.94306
S:1-T:0-0.14286-0.689160.403450.97348
T:1-T:0-0.055901-0.587330.475530.99963
S:1-E:1-0.31579-0.818040.186460.4532
T:1-E:1-0.22883-0.714860.257190.74567
T:1-S:10.086957-0.392370.566280.99495

\begin{tabular}{lllllllll}
\hline
Tukey Honest Significant Difference Comparisons \tabularnewline
  & diff & lwr & upr & p adj \tabularnewline
S-E & -0.30649 & -0.61794 & 0.0049505 & 0.054759 \tabularnewline
T-E & -0.25553 & -0.56286 & 0.051804 & 0.12291 \tabularnewline
T-S & 0.050965 & -0.25169 & 0.35362 & 0.91539 \tabularnewline
1-0 & -0.099976 & -0.31239 & 0.11244 & 0.35263 \tabularnewline
S:0-E:0 & -0.29524 & -0.87783 & 0.28735 & 0.68223 \tabularnewline
T:0-E:0 & -0.28571 & -0.87827 & 0.30684 & 0.72613 \tabularnewline
E:1-E:0 & -0.11278 & -0.66498 & 0.43941 & 0.99125 \tabularnewline
S:1-E:0 & -0.42857 & -0.97488 & 0.11773 & 0.21214 \tabularnewline
T:1-E:0 & -0.34161 & -0.87305 & 0.18982 & 0.42774 \tabularnewline
T:0-S:0 & 0.0095238 & -0.57307 & 0.59212 & 1 \tabularnewline
E:1-S:0 & 0.18246 & -0.35904 & 0.72395 & 0.9235 \tabularnewline
S:1-S:0 & -0.13333 & -0.66882 & 0.40215 & 0.97861 \tabularnewline
T:1-S:0 & -0.046377 & -0.56668 & 0.47393 & 0.99984 \tabularnewline
E:1-T:0 & 0.17293 & -0.37926 & 0.72513 & 0.94306 \tabularnewline
S:1-T:0 & -0.14286 & -0.68916 & 0.40345 & 0.97348 \tabularnewline
T:1-T:0 & -0.055901 & -0.58733 & 0.47553 & 0.99963 \tabularnewline
S:1-E:1 & -0.31579 & -0.81804 & 0.18646 & 0.4532 \tabularnewline
T:1-E:1 & -0.22883 & -0.71486 & 0.25719 & 0.74567 \tabularnewline
T:1-S:1 & 0.086957 & -0.39237 & 0.56628 & 0.99495 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160409&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]S-E[/C][C]-0.30649[/C][C]-0.61794[/C][C]0.0049505[/C][C]0.054759[/C][/ROW]
[ROW][C]T-E[/C][C]-0.25553[/C][C]-0.56286[/C][C]0.051804[/C][C]0.12291[/C][/ROW]
[ROW][C]T-S[/C][C]0.050965[/C][C]-0.25169[/C][C]0.35362[/C][C]0.91539[/C][/ROW]
[ROW][C]1-0[/C][C]-0.099976[/C][C]-0.31239[/C][C]0.11244[/C][C]0.35263[/C][/ROW]
[ROW][C]S:0-E:0[/C][C]-0.29524[/C][C]-0.87783[/C][C]0.28735[/C][C]0.68223[/C][/ROW]
[ROW][C]T:0-E:0[/C][C]-0.28571[/C][C]-0.87827[/C][C]0.30684[/C][C]0.72613[/C][/ROW]
[ROW][C]E:1-E:0[/C][C]-0.11278[/C][C]-0.66498[/C][C]0.43941[/C][C]0.99125[/C][/ROW]
[ROW][C]S:1-E:0[/C][C]-0.42857[/C][C]-0.97488[/C][C]0.11773[/C][C]0.21214[/C][/ROW]
[ROW][C]T:1-E:0[/C][C]-0.34161[/C][C]-0.87305[/C][C]0.18982[/C][C]0.42774[/C][/ROW]
[ROW][C]T:0-S:0[/C][C]0.0095238[/C][C]-0.57307[/C][C]0.59212[/C][C]1[/C][/ROW]
[ROW][C]E:1-S:0[/C][C]0.18246[/C][C]-0.35904[/C][C]0.72395[/C][C]0.9235[/C][/ROW]
[ROW][C]S:1-S:0[/C][C]-0.13333[/C][C]-0.66882[/C][C]0.40215[/C][C]0.97861[/C][/ROW]
[ROW][C]T:1-S:0[/C][C]-0.046377[/C][C]-0.56668[/C][C]0.47393[/C][C]0.99984[/C][/ROW]
[ROW][C]E:1-T:0[/C][C]0.17293[/C][C]-0.37926[/C][C]0.72513[/C][C]0.94306[/C][/ROW]
[ROW][C]S:1-T:0[/C][C]-0.14286[/C][C]-0.68916[/C][C]0.40345[/C][C]0.97348[/C][/ROW]
[ROW][C]T:1-T:0[/C][C]-0.055901[/C][C]-0.58733[/C][C]0.47553[/C][C]0.99963[/C][/ROW]
[ROW][C]S:1-E:1[/C][C]-0.31579[/C][C]-0.81804[/C][C]0.18646[/C][C]0.4532[/C][/ROW]
[ROW][C]T:1-E:1[/C][C]-0.22883[/C][C]-0.71486[/C][C]0.25719[/C][C]0.74567[/C][/ROW]
[ROW][C]T:1-S:1[/C][C]0.086957[/C][C]-0.39237[/C][C]0.56628[/C][C]0.99495[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160409&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160409&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
S-E-0.30649-0.617940.00495050.054759
T-E-0.25553-0.562860.0518040.12291
T-S0.050965-0.251690.353620.91539
1-0-0.099976-0.312390.112440.35263
S:0-E:0-0.29524-0.877830.287350.68223
T:0-E:0-0.28571-0.878270.306840.72613
E:1-E:0-0.11278-0.664980.439410.99125
S:1-E:0-0.42857-0.974880.117730.21214
T:1-E:0-0.34161-0.873050.189820.42774
T:0-S:00.0095238-0.573070.592121
E:1-S:00.18246-0.359040.723950.9235
S:1-S:0-0.13333-0.668820.402150.97861
T:1-S:0-0.046377-0.566680.473930.99984
E:1-T:00.17293-0.379260.725130.94306
S:1-T:0-0.14286-0.689160.403450.97348
T:1-T:0-0.055901-0.587330.475530.99963
S:1-E:1-0.31579-0.818040.186460.4532
T:1-E:1-0.22883-0.714860.257190.74567
T:1-S:10.086957-0.392370.566280.99495







Levenes Test for Homogeneity of Variance
DfF valuePr(>F)
Group51.34790.25067
99

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

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



Parameters (Session):
par1 = 4 ; par2 = 3 ; par3 = 5 ; par4 = TRUE ;
Parameters (R input):
par1 = 4 ; par2 = 3 ; par3 = 5 ; 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')