[R] ANCOVA with defined error terms

hpdutra hpdutra at yahoo.com
Sun Aug 23 15:13:23 CEST 2009


What does the command 
c:\progra~1\R\R-2.9.1\bin\Rgui --vanilla
do?
At first I thought that I could run it from R.  But then it did not work.
I'm using a mac, and I don't know how access MSDOS in a mac. I actually
installed R on the pc and tried to run the command from MSDOS and it also
didn't work. 
could you please tell me what were you trying to do? I'm guessing that you
were trying to get an R console that is absolutely clean, I think that what
you meant by fresh copy of R.
Anyway, I ran the same model on the pc,  this is a fresh copy, there is
nothing attached or stored. 

mymodel<-(aov(mice~veget*fruit*time+(time*block)+(time*block*veget)+(time*block*fruit)+coon+Error(block/plot),
data = track))
Warning message:
In aov(mice ~ veget * fruit * time + (time * block) + (time * block *  :
  Error() model is singular

summary(mymodel)

Error: block
      Df Sum Sq Mean Sq
block  2 4581.5  2290.7

Error: block:plot
            Df  Sum Sq Mean Sq  F value  Pr(>F)  
veget        1 1602.91 1602.91 379.1653 0.03267 *
fruit        1   80.07   80.07  18.9411 0.14378  
coon         1  193.53  193.53  45.7791 0.09341 .
veget:fruit  1   40.26   40.26   9.5245 0.19948  
veget:block  2  355.53  177.76  42.0495 0.10840  
fruit:block  2   15.39    7.69   1.8200 0.46423  
Residuals    1    4.23    4.23                   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Error: Within
                 Df Sum Sq Mean Sq F value    Pr(>F)    
time             13 8451.5   650.1  8.7462 2.384e-06 ***
coon              1 1070.7  1070.7 14.4047 0.0008364 ***
veget:time       13 1214.4    93.4  1.2568 0.3006216    
fruit:time       13  474.7    36.5  0.4912 0.9090773    
time:block       26 2943.4   113.2  1.5230 0.1482787    
veget:fruit:time 13  726.1    55.9  0.7514 0.6992585    
veget:time:block 26 2194.9    84.4  1.1357 0.3762584    
fruit:time:block 26 2672.5   102.8  1.3828 0.2103929    
Residuals        25 1858.3    74.3                      
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

or using yours
ricsmodel<-aov(mice ~ coon + block*veget*fruit*time -
block:veget:fruit:time+ Error(block/plot), data = track)
Warning message:
In aov(mice ~ coon + block * veget * fruit * time - block:veget:fruit:time + 
:
  Error() model is singular
> summary(ricsmodel)

Error: block
      Df Sum Sq Mean Sq
coon   1 1104.4  1104.4
block  1 3477.1  3477.1

Error: block:plot
                  Df  Sum Sq Mean Sq
coon               1  240.13  240.13
veget              1 1629.40 1629.40
fruit              1    6.98    6.98
block:veget        2  247.59  123.79
block:fruit        2   36.97   18.49
veget:fruit        1  126.62  126.62
block:veget:fruit  1    4.23    4.23

Error: Within
                 Df Sum Sq Mean Sq F value    Pr(>F)    
coon              1  904.4   904.4 12.1673  0.001819 ** 
time             13 8617.8   662.9  8.9183 1.986e-06 ***
block:time       26 2945.9   113.3  1.5243  0.147803    
veget:time       13 1209.2    93.0  1.2513  0.303764    
fruit:time       13  477.5    36.7  0.4941  0.907294    
block:veget:time 26 2201.5    84.7  1.1392  0.373409    
block:fruit:time 26 2706.7   104.1  1.4006  0.201399    
veget:fruit:time 13  685.2    52.7  0.7091  0.737650    
Residuals        25 1858.3    74.3                      
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
> summary(mymodel)

Thank you
Humberto




Richard M. Heiberger wrote:
> 
> Your model formula cannot be correct.
> 
> The phrase
> Error(block/plot, data = track)
> 
> is wrong.
> 
> It has to be something like this
> Error(block/plot), data = track
> 
> The Error function requires a well-defined formula.
> The "," character cannot be inside the Error function.
> 
> 
> 
> You misunderstood my use of sapply.
> I am illustrating the number of levels for each of the factors.
> That is information about the data.frame.
> It is not part of a model specification.
> 
> 
> 
> I need reproducible code to do anything further.
> I need exactly three complete statements of the form
> 
>     track <- structure(....)    ## from your earlier email
>     mymodel <- aov(   formula + Error(errorformula), data=track)
>     summary(mymodel)
> 
> Do not attach() anything.  I am wondering now if that use of the
> attach() function in early email was part of your difficulty.
> 
> When you have those three statements ready, open a fresh copy
> of R with the MSDOS command statement
> 
>     c:\progra~1\R\R-2.9.1\bin\Rgui --vanilla
> 
> Then paste the three statements in.  If that works, send the three
> statements.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: http://www.nabble.com/ANCOVA-with-defined-error-terms-tp25055311p25103194.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list