[R] RDA and trend surface regression

Kuhn, Max Max.Kuhn at pfizer.com
Tue Feb 27 01:49:40 CET 2007


Helene,

You will have to give us more information, such as your system/versions
and a small reproducible example. We try to stress that questions are
more easily answered when there are a lot of specific details given and
a reproducible case can be tested.

Here are two comments though:

 1. The quadratic terms probably are not showing up because you are not
using a proper model formula for the task. See:

http://cran.r-project.org/doc/manuals/R-intro.html#Formulae-for-statisti
cal-models

Specifically, the part that says

"I(M): Insulate M. Inside M all operators have their normal arithmetic
meaning, and that term appears in the model matrix. "

is important. So, as an example from ?rda:

 x <- rda(Species ~ (Sepal.Length+Sepal.Width)^2 + Sepal.Width^2, data =
iris)

would not work for the squared term, but

 x <- rda(Species ~ (Sepal.Length+Sepal.Width)^2 + I(Sepal.Width^2),
data = iris)

would.

2. RDA is fitting models at or between LDA and QDA. So a QDA model with
quadratic terms would be quartic discriminant analysis. Of course, there
are no rules against this, but high order polynomials can do weird
things in the tail (which would be the edges of the space defined by
your training data). If your data are that nonlinear, there are much
better ways of classifying data. I'd suggests getting a copy of Hastie
et all (2001) or MASS.

Max



-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of MORLON
Sent: Monday, February 26, 2007 7:14 PM
To: r-help at stat.math.ethz.ch
Subject: [R] RDA and trend surface regression

Dear all,

 

I'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

 

I hope you can help me with that: "how can I perform a RDA on an
extended
matrix of geographical coordinates in R?".

 

Thank you very much in advance,

 

Helene Morlon

University of California, Merced

morlon.helene at gmail.com

 


	[[alternative HTML version deleted]]

______________________________________________
R-help at stat.math.ethz.ch 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.

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



More information about the R-help mailing list