[R] Error when calling residual.plots() on an ANOVA object

Max Manfrin mmanfrin at ulb.ac.be
Tue Mar 27 18:40:52 CEST 2007


Dear *,
	I have to perform an ANOVA analysis to study the effects on the  
performance of some algorithmic components in the design of my  
algorithm.

	I have done a full factorial design for the following 5 factors (my  
response variable is "best"):

  $ model        :'data.frame':	3360 obs. of  6 variables:
   ..$ best      : num [1:3360] 0.108 0.573 0.625 1.057 0.451 ...
   ..$ comm.strat: Factor w/ 4 levels "FC","HC","R",..: 1 1 1 1 1 1 1  
1 1 1 ...
   ..$ migr.freq : Factor w/ 2 levels "d","s": 1 1 1 1 1 1 1 1 1 1 ...
   ..$ max.cpu   : Ord.factor w/ 2 levels "4"<"8": 1 1 1 1 1 1 1 1 1  
1 ...
   ..$ instance  : Factor w/ 7 levels "kroA100","eil101",..: 1 1 1 1  
1 1 1 1 1 1 ...
   ..$ max.iter  : Ord.factor w/ 3 levels "1000"<"3162"<..: 1 1 1 1 1  
1 1 1 1 1 ...

I would like to plot the residuals for my 5 factors, but when I call  
the function residual.plots(), only the first 3 plots (comm.strat,  
migr.freq, max.cpu) are done and then I obtain an error:

 > anova.ax3<-aov(best~(comm.strat+migr.freq+max.cpu+instance 
+max.iter)^2,data=BestDF)
 > summary(anova.ax3)
                        Df  Sum Sq Mean Sq   F value    Pr(>F)
comm.strat              3     5.3     1.8    2.5530    0.0538 .
migr.freq               1   246.9   246.9  358.8027 < 2.2e-16 ***
max.cpu                 1   201.6   201.6  292.8771 < 2.2e-16 ***
instance                6 15140.0  2523.3 3666.4180 < 2.2e-16 ***
max.iter                2  3872.2  1936.1 2813.1683 < 2.2e-16 ***
comm.strat:migr.freq    3     3.7     1.2    1.7763    0.1495
comm.strat:max.cpu      3     1.3     0.4    0.6175    0.6036
comm.strat:instance    18    48.8     2.7    3.9369 4.050e-08 ***
comm.strat:max.iter     6     2.7     0.5    0.6568    0.6847
migr.freq:max.cpu       1     2.1     2.1    3.0109    0.0828 .
migr.freq:instance      6   379.5    63.2   91.9026 < 2.2e-16 ***
migr.freq:max.iter      2   324.4   162.2  235.7037 < 2.2e-16 ***
max.cpu:instance        6    27.2     4.5    6.5894 6.182e-07 ***
max.cpu:max.iter        2    15.6     7.8   11.3535 1.220e-05 ***
instance:max.iter      12  2105.8   175.5  254.9806 < 2.2e-16 ***
Residuals            3287  2262.2     0.7
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 >
 > residual.plots(anova.ax3,ask=FALSE)
Error in Summary.factor(..., na.rm = na.rm) :
	min not meaningful for factors
In addition: Warning message:
the condition has length > 1 and only the first element will be used  
in: if (class(horiz) != "factor") {
 >

I think that there is some issues when processing the "instance"  
factor (the levels are names of instances).

Could somebody give me a hand to understand what is going on?

This is the script I use to make the analysis:


-----= BEGIN R SCRIPT =-----

datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
kroA100_4CPU_1000.best"
instance1_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
kroA100_8CPU_1000.best"
instance1_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
eil101_4CPU_1000.best"
instance2_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
eil101_8CPU_1000.best"
instance2_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
kroA200_4CPU_1000.best"
instance3_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
kroA200_8CPU_1000.best"
instance3_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
lin318_4CPU_1000.best"
instance4_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
lin318_8CPU_1000.best"
instance4_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
pcb442_4CPU_1000.best"
instance5_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
pcb442_8CPU_1000.best"
instance5_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
att532_4CPU_1000.best"
instance6_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
att532_8CPU_1000.best"
instance6_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
rat783_4CPU_1000.best"
instance7_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
rat783_8CPU_1000.best"
instance7_8<-read.table(datafilename,header=TRUE)

datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
kroA100_4CPU_3162.best"
instance8_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
kroA100_8CPU_3162.best"
instance8_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
eil101_4CPU_3162.best"
instance9_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
eil101_8CPU_3162.best"
instance9_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
kroA200_4CPU_3162.best"
instance10_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
kroA200_8CPU_3162.best"
instance10_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
lin318_4CPU_3162.best"
instance11_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
lin318_8CPU_3162.best"
instance11_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
pcb442_4CPU_3162.best"
instance12_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
pcb442_8CPU_3162.best"
instance12_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
att532_4CPU_3162.best"
instance13_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
att532_8CPU_3162.best"
instance13_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
rat783_4CPU_3162.best"
instance14_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
rat783_8CPU_3162.best"
instance14_8<-read.table(datafilename,header=TRUE)

datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
kroA100_4CPU_10000.best"
instance15_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
kroA100_8CPU_10000.best"
instance15_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
eil101_4CPU_10000.best"
instance16_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
eil101_8CPU_10000.best"
instance16_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
kroA200_4CPU_10000.best"
instance17_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
kroA200_8CPU_10000.best"
instance17_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
lin318_4CPU_10000.best"
instance18_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
lin318_8CPU_10000.best"
instance18_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
pcb442_4CPU_10000.best"
instance19_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
pcb442_8CPU_10000.best"
instance19_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
att532_4CPU_10000.best"
instance20_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
att532_8CPU_10000.best"
instance20_8<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
rat783_4CPU_10000.best"
instance21_4<-read.table(datafilename,header=TRUE)
datafilename="http://landau.ulb.ac.be/~mmanfrin/ANOVA/noLS/ 
rat783_8CPU_10000.best"
instance21_8<-read.table(datafilename,header=TRUE)

bestalgo<-rbind 
(instance1_4,instance1_8,instance2_4,instance2_8,instance3_4,instance3_8 
,instance4_4,instance4_8,instance5_4,instance5_8,instance6_4,instance6_8 
,instance7_4,instance7_8,instance8_4,instance8_8,instance9_4,instance9_8 
,instance10_4,instance10_8,instance11_4,instance11_8,instance12_4,instan 
ce12_8,instance13_4,instance13_8,instance14_4,instance14_8,instance15_4, 
instance15_8,instance16_4,instance16_8,instance17_4,instance17_8,instanc 
e18_4,instance18_8,instance19_4,instance19_8,instance20_4,instance20_8,i 
nstance21_4,instance21_8)

BestDF<-bestalgo[bestalgo$algo.id!="SEQ0" & bestalgo$algo.id!="PIR0",]
BestDF$comm.strat<-factor(BestDF$comm.strat,ordered=FALSE)
BestDF$cpu.id<-factor(BestDF$cpu.id,ordered=FALSE)
BestDF$try<-factor(BestDF$try,ordered=FALSE)
BestDF$max.cpu<-factor(BestDF$max.cpu,ordered=TRUE)
BestDF$max.iter<-factor(BestDF$max.iter,ordered=TRUE)
BestDF$instance<-factor(BestDF$instance,ordered=FALSE)
BestDF$migr.freq<-factor(BestDF$migr.freq,ordered=FALSE)

anova.ax3<-aov(best~(comm.strat+migr.freq+max.cpu+instance+max.iter) 
^2,data=BestDF)
summary(anova.ax3)

library(alr3)
residual.plots(anova.ax3,ask=FALSE)

-----= END R SCRIPT =-----

Thanks in advance for any help you could provide.


--------------------------------------------------------------------
Max MANFRIN                                 Tel.: +32 (0)2 650 3168
IRIDIA - CoDE, CP 194/6                     Fax.: +32 (0)2 650 2715
Université Libre de Bruxelles
Av. F. D. Roosevelt, 50
1050 Brussels                             Email: mmanfrin at ulb.ac.be
BELGIUM                      WWW: http://iridia.ulb.ac.be/~mmanfrin

gpg DSA: 0x7E67B4C4
gpg fingerprint: C2E9 1689 CADD 7CAE 2FAB A355 8FD9 9DD1 7E67 B4C4
--------------------------------------------------------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20070327/5e7fc789/attachment.bin 


More information about the R-help mailing list