[R-sig-eco] vegan RsquareAdj() for lm models

Paolo Piras paolo.piras at uniroma3.it
Thu Oct 3 13:59:15 CEST 2013


Dear list,
I would like to easily compute the adjusted R-square in a lm model without intercept (excluding the intercept is essential for my analysis)

I found that RsquareAdj() in vegan returns NA if the argument is  a multiple-multivariate lm model thus including multivariate responses and multiple predictors, while it works for univariate response and multiple predictors. 

For example:
library(vegan)

yy<-matrix(rnorm(200,0,1),ncol=4)
xx<-matrix(rnorm(200,0,1),ncol=4)
RsquareAdj(lm(yy~xx-1))
RsquareAdj(lm(yy[,1]~xx-1))



There some specific reason for this behavior?
Thanks in advance for any advice
best regards
Poalo








More information about the R-sig-ecology mailing list