[R] RDA and trend surface regression

Kuhn, Max Max.Kuhn at pfizer.com
Tue Feb 27 19:13:08 CET 2007


Helene,

My point was only that RDA may fit a quadratic model for the terms
specified in your model. The terms that you had specified were already
higher order polynomials (some cubic). So a QDA classifier with the
model terms that you specified my be a fifth order polynomial in the
original data. I don't know the reference you cite or even the
subject-matter specifics. I'm just a simple cave man (for you SNL fans).
But I do know that there are more reliable ways to get nonlinear
classification boundaries than using x^5. 

If you want a quadratic model, I would suggest that you use QDA with the
predictors in the original units (or see Hastie's book for a good
example of using higher order terms with LDA). 

Looking at your email, you want a "a variation partitioning analyses".
RDA works best as a classification technique. Perhaps a multivariate
ANOVA model may be a more direct way to meet your needs. There is a
connection between LDA and some multivariate linear models, but I don't
know of a similar connection to RDA.

Max

-----Original Message-----
From: MORLON [mailto:morlon.helene at gmail.com] 
Sent: Tuesday, February 27, 2007 12:53 PM
To: 'Jari Oksanen'; r-help at stat.math.ethz.ch
Cc: Kuhn, Max
Subject: RE: [R] RDA and trend surface regression

Thanks a lot for your answers,

I am concerned by your advice not to use polynomial constraints, or to
use
QDA instead of RDA. My final goal is to perform variation partitioning
using
partial RDA to assess the relative importance of environmental vs
spatial
variables. For the spatial analyses, trend surface analysis (polynomial
constraints) is recommended in Legendre and Legendre 1998 (p739). Is
there a
better method to integrate space as an explanatory variable in a
variation
partitioning analyses? 

Also, I don't understand this: when I test for the significant
contribution
of monomials (forward elimination)

>anova(rda(Helling ~ I(x^2)+Condition(x)+Condition(y)))

performs the permutation test as expected, whereas 

>anova(rda(Helling ~ I(y^2)+Condition(x)+Condition(y)))

Returns this error message:

Error in "names<-.default"(`*tmp*`, value = "Model") : 
        attempt to set an attribute on NULL

Thanks again for your help
Kind regards,
Helene

Helene MORLON
University of California, Merced

-----Original Message-----
From: Jari Oksanen [mailto:jarioksa at sun3.oulu.fi] 
Sent: Monday, February 26, 2007 11:27 PM
To: r-help at stat.math.ethz.ch
Cc: morlon.helene at gmail.com
Subject: [R] RDA and trend surface regression


> 'm performing RDA on plant presence/absence data, constrained by
> geographical locations. I'd like to constrain the RDA by the "extended
> matrix of geographical coordinates" -ie the matrix of geographical
> coordinates completed by adding all terms of a cubic trend surface
> regression- . 
> 
> This is the command I use (package vegan):
> 
>  
> 
> >rda(Helling ~ x+y+x*y+x^2+y^2+x*y^2+y*x^2+x^3+y^3) 
> 
>  
> 
> where Helling is the matrix of Hellinger-transformed presence/absence
data
> 
> The result returned by R is exactly the same as the one given by:
> 
>  
> 
> >anova(rda(Helling ~ x+y)
> 
>  
> 
> Ie the quadratic and cubic terms are not taken into account
> 

You must *I*solate the polynomial terms with function I ("AsIs") so that
they are not interpreted as formula operators:

rda(Helling ~ x + y + I(x*y) + I(x^2) + I(y^2) + I(x*y^2) + I(y*x^2) +
I(x^3) + I(y^3))

If you don't have the interaction terms, then it is easier and better
(numerically) to use poly():

rda(Helling ~ poly(x, 3) + poly(y, 3))

Another issue is that in my opinion using polynomial constraints is an
Extremely Bad Idea(TM).

cheers, Jari Oksanen

----------------------------------------------------------------------
LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}



More information about the R-help mailing list