[R] problems with glht for ancova

gaiarrido gaiarrido at usal.es
Wed Jan 11 10:42:32 CET 2012


I've run an ancova, edadysexo is a factor with 3 levels,and log(lcc) is the
covariate (continous variable)
I get this results


> ancova<-aov(log(peso)~edadysexo*log(lcc))
> summary(ancova)
                    Df Sum Sq Mean Sq  F value Pr(>F)    
edadysexo            2 31.859 15.9294 803.9843 <2e-16 ***
log(lcc)             1 11.389 11.3887 574.8081 <2e-16 ***
edadysexo:log(lcc)   2  0.063  0.0317   1.6021 0.2025    
Residuals          509 10.085  0.0198                    

Then, I tried to do a post-hoc using glht from multcomp package, but,
because the interaction it's not siginificant i did it just for the factor 


> summary(glht(ancova, linfct=mcp(edadysexo="Tukey")))

         Simultaneous Tests for General Linear Hypotheses

Multiple Comparisons of Means: Tukey Contrasts


Fit: aov(formula = log(peso) ~ edadysexo * log(lcc))

Linear Hypotheses:
             Estimate Std. Error t value Pr(>|t|)
M - H == 0    -1.8218     1.1111  -1.640    0.230
SUB - H == 0  -0.9298     1.1957  -0.778    0.717
SUB - M == 0   0.8921     1.1130   0.801    0.702
(Adjusted p values reported -- single-step method)

Mensajes de aviso perdidos
In mcp2matrix(model, linfct = linfct) :
  covariate interactions found -- default contrast might be inappropriate


Two question:
1) Why I don't get differences in edadysexo when i got it in the ancova
2) About the warning message. Why R said "covariate interactions found" of i
didn't get it in the ancova

Next, i tried to made glht with the interaction, but, obviously, i got an
error because Tukey just work with factors.  


> summary(glht(ancova, linfct=mcp(edadysexo*log(lcc)="Tukey")))
Error: inesperado '=' en "summary(glht(ancova,
linfct=mcp(edadysexo*log(lcc)="

What should i do?

Thanks in advance

-----
Mario Garrido Escudero
PhD student
Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola
Universidad de Salamanca
--
View this message in context: http://r.789695.n4.nabble.com/problems-with-glht-for-ancova-tp4284908p4284908.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list