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 computationThu, 08 Mar 2012 06:28:09 -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/Mar/08/t13312061827gszohb4tlqbhjk.htm/, Retrieved Sat, 04 May 2024 11:02:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=163738, Retrieved Sat, 04 May 2024 11:02:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact119
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Two-Way ANOVA] [2x2 ANOVA] [2012-03-08 11:28:09] [169ec5fb8eb5ef8d9bbbf91dacc5bfc6] [Current]
Feedback Forum

Post a new message
Dataseries X:
'Upright'	'Famous'	274
'Upright'	'Famous'	818.8
'Upright'	'Famous'	591.2
'Upright'	'Famous'	215.8
'Upright'	'Famous'	243
'Upright'	'Famous'	567.2
'Upright'	'Non-Famous'	573.6
'Upright'	'Non-Famous'	658.2
'Upright'	'Non-Famous'	558.4
'Upright'	'Non-Famous'	301
'Upright'	'Non-Famous'	586.4
'Upright'	'Non-Famous'	676.6
'Upside down'	'Famous'	367.4
'Upside down'	'Famous'	761.4
'Upside down'	'Famous'	742.8
'Upside down'	'Famous'	467.4
'Upside down'	'Famous'	235.2
'Upside down'	'Famous'	723.6
'Upside down'	'Non-Famous'	663.6
'Upside down'	'Non-Famous'	790.4
'Upside down'	'Non-Famous'	495.2
'Upside down'	'Non-Famous'	485.8
'Upside down'	'Non-Famous'	267.8
'Upside down'	'Non-Famous'	451.8




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

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







ANOVA Model
xdf2$RT ~ xdf2$Orientation * xdf2$Type_of_face
names(Intercept)xdf2$OrientationUpside,downxdf2$Type_of_faceNon-Famousxdf2$OrientationUpside,down:xdf2$Type_of_faceNon-Famous
means451.6797.967107.37-131.23

\begin{tabular}{lllllllll}
\hline
ANOVA Model \tabularnewline
xdf2$RT ~ xdf2$Orientation * xdf2$Type_of_face \tabularnewline
names & (Intercept) & xdf2$OrientationUpside,down & xdf2$Type_of_faceNon-Famous & xdf2$OrientationUpside,down:xdf2$Type_of_faceNon-Famous \tabularnewline
means & 451.67 & 97.967 & 107.37 & -131.23 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=163738&T=1

[TABLE]
[ROW][C]ANOVA Model[/C][/ROW]
[ROW][C]xdf2$RT ~ xdf2$Orientation * xdf2$Type_of_face[/C][/ROW]
[ROW][C]names[/C][C](Intercept)[/C][C]xdf2$OrientationUpside,down[/C][C]xdf2$Type_of_faceNon-Famous[/C][C]xdf2$OrientationUpside,down:xdf2$Type_of_faceNon-Famous[/C][/ROW]
[ROW][C]means[/C][C]451.67[/C][C]97.967[/C][C]107.37[/C][C]-131.23[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=163738&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=163738&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$RT ~ xdf2$Orientation * xdf2$Type_of_face
names(Intercept)xdf2$OrientationUpside,downxdf2$Type_of_faceNon-Famousxdf2$OrientationUpside,down:xdf2$Type_of_faceNon-Famous
means451.6797.967107.37-131.23







ANOVA Statistics
DfSum SqMean SqF valuePr(>F)
1
xdf2$Orientation16279.16279.10.156120.69693
xdf2$Type_of_face110458104580.260030.61568
xdf2$Orientation:xdf2$Type_of_face125833258330.642310.43229
Residuals2080438040219

\begin{tabular}{lllllllll}
\hline
ANOVA Statistics \tabularnewline
  & Df & Sum Sq & Mean Sq & F value & Pr(>F) \tabularnewline
 & 1 &  &  &  &  \tabularnewline
xdf2$Orientation & 1 & 6279.1 & 6279.1 & 0.15612 & 0.69693 \tabularnewline
xdf2$Type_of_face & 1 & 10458 & 10458 & 0.26003 & 0.61568 \tabularnewline
xdf2$Orientation:xdf2$Type_of_face & 1 & 25833 & 25833 & 0.64231 & 0.43229 \tabularnewline
Residuals & 20 & 804380 & 40219 &   &   \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=163738&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]1[/C][C][/C][C][/C][C][/C][C][/C][/ROW]
[ROW][C]xdf2$Orientation[/C][C]1[/C][C]6279.1[/C][C]6279.1[/C][C]0.15612[/C][C]0.69693[/C][/ROW]
[ROW][C]xdf2$Type_of_face[/C][C]1[/C][C]10458[/C][C]10458[/C][C]0.26003[/C][C]0.61568[/C][/ROW]
[ROW][C]xdf2$Orientation:xdf2$Type_of_face[/C][C]1[/C][C]25833[/C][C]25833[/C][C]0.64231[/C][C]0.43229[/C][/ROW]
[ROW][C]Residuals[/C][C]20[/C][C]804380[/C][C]40219[/C][C] [/C][C] [/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=163738&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=163738&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)
1
xdf2$Orientation16279.16279.10.156120.69693
xdf2$Type_of_face110458104580.260030.61568
xdf2$Orientation:xdf2$Type_of_face125833258330.642310.43229
Residuals2080438040219







Tukey Honest Significant Difference Comparisons
difflwruprp adj
Upside,down-Upright32.35-138.43203.130.69693
Non-Famous-Famous41.75-129.03212.530.61568
Upside,down:Famous-Upright:Famous97.967-226.11422.040.83188
Upright:Non-Famous-Upright:Famous107.37-216.71431.440.7907
Upside,down:Non-Famous-Upright:Famous74.1-249.98398.180.91778
Upright:Non-Famous-Upside,down:Famous9.4-314.68333.480.9998
Upside,down:Non-Famous-Upside,down:Famous-23.867-347.94300.210.9968
Upside,down:Non-Famous-Upright:Non-Famous-33.267-357.34290.810.99147

\begin{tabular}{lllllllll}
\hline
Tukey Honest Significant Difference Comparisons \tabularnewline
  & diff & lwr & upr & p adj \tabularnewline
Upside,down-Upright & 32.35 & -138.43 & 203.13 & 0.69693 \tabularnewline
Non-Famous-Famous & 41.75 & -129.03 & 212.53 & 0.61568 \tabularnewline
Upside,down:Famous-Upright:Famous & 97.967 & -226.11 & 422.04 & 0.83188 \tabularnewline
Upright:Non-Famous-Upright:Famous & 107.37 & -216.71 & 431.44 & 0.7907 \tabularnewline
Upside,down:Non-Famous-Upright:Famous & 74.1 & -249.98 & 398.18 & 0.91778 \tabularnewline
Upright:Non-Famous-Upside,down:Famous & 9.4 & -314.68 & 333.48 & 0.9998 \tabularnewline
Upside,down:Non-Famous-Upside,down:Famous & -23.867 & -347.94 & 300.21 & 0.9968 \tabularnewline
Upside,down:Non-Famous-Upright:Non-Famous & -33.267 & -357.34 & 290.81 & 0.99147 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=163738&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]Upside,down-Upright[/C][C]32.35[/C][C]-138.43[/C][C]203.13[/C][C]0.69693[/C][/ROW]
[ROW][C]Non-Famous-Famous[/C][C]41.75[/C][C]-129.03[/C][C]212.53[/C][C]0.61568[/C][/ROW]
[ROW][C]Upside,down:Famous-Upright:Famous[/C][C]97.967[/C][C]-226.11[/C][C]422.04[/C][C]0.83188[/C][/ROW]
[ROW][C]Upright:Non-Famous-Upright:Famous[/C][C]107.37[/C][C]-216.71[/C][C]431.44[/C][C]0.7907[/C][/ROW]
[ROW][C]Upside,down:Non-Famous-Upright:Famous[/C][C]74.1[/C][C]-249.98[/C][C]398.18[/C][C]0.91778[/C][/ROW]
[ROW][C]Upright:Non-Famous-Upside,down:Famous[/C][C]9.4[/C][C]-314.68[/C][C]333.48[/C][C]0.9998[/C][/ROW]
[ROW][C]Upside,down:Non-Famous-Upside,down:Famous[/C][C]-23.867[/C][C]-347.94[/C][C]300.21[/C][C]0.9968[/C][/ROW]
[ROW][C]Upside,down:Non-Famous-Upright:Non-Famous[/C][C]-33.267[/C][C]-357.34[/C][C]290.81[/C][C]0.99147[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=163738&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=163738&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
Upside,down-Upright32.35-138.43203.130.69693
Non-Famous-Famous41.75-129.03212.530.61568
Upside,down:Famous-Upright:Famous97.967-226.11422.040.83188
Upright:Non-Famous-Upright:Famous107.37-216.71431.440.7907
Upside,down:Non-Famous-Upright:Famous74.1-249.98398.180.91778
Upright:Non-Famous-Upside,down:Famous9.4-314.68333.480.9998
Upside,down:Non-Famous-Upside,down:Famous-23.867-347.94300.210.9968
Upside,down:Non-Famous-Upright:Non-Famous-33.267-357.34290.810.99147







Levenes Test for Homogeneity of Variance
DfF valuePr(>F)
Group31.91760.15926
20

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

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



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