Re: [R] R-squared for MARS models

From: Gavin Simpson <gavin.simpson_at_ucl.ac.uk>
Date: Thu 20 Apr 2006 - 17:31:31 EST

On Wed, 2006-04-19 at 21:18 +0200, Marco Girardello wrote:
> Hi,
>
> is there an R function which can compute the R-squared
> for a mars model fitted using the mda package?
>
> many thanks in advance
>
> best regards
>
> Marco Girardello

Julian Faraway's "Extending the Linear Model with R" Chapman & Hall/CRC (page 248)has a small section on MARS and compares the MARS fit with other methods by using the MARS basis functions in a linear model to get an R^2:

# page 248 example
library(faraway)
library(mda)
data(ozone)
a <- mars(ozone[,-1], ozone[,])
(a.summ <- summary(lm(ozone[,1] ~ a$x-1))) a.summ$r.squared

HTH G

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 *Note new Address and Fax and Telephone numbers from 10th April 2006*
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson                     [t] +44 (0)20 7679 0522
ECRC                              [f] +44 (0)20 7679 0565
UCL Department of Geography
Pearson Building                  [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street
London, UK                        [w] http://www.ucl.ac.uk/~ucfagls/cv/
WC1E 6BT                          [w] http://www.ucl.ac.uk/~ucfagls/
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

______________________________________________
R-help@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
Received on Thu Apr 20 17:36:53 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 20 Apr 2006 - 18:09:56 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.