Re: [R] Testing additive nonparametric model

From: vito muggeo <vmuggeo_at_dssm.unipa.it>
Date: Tue 03 Apr 2007 - 09:43:24 GMT

You can use the LRT (although I think that it assumes the df to be fixed). For instance the package mgcv by Simon Wood has an anova method to compare models fitted by the relevant gam() function, and the print.summary() itself returns such information..

best,
vito

set.seed(123)
n<-100

sig<-2
x0 <- runif(n, 0, 1)
x1 <- runif(n, 0, 1)

y <- sin(2*pi*x0) + .5*x1 +sig*rnorm(n)
library(mgcv)
obj<-gam(y~s(x0)+s(x1))
obj1<-gam(y~s(x0)+x1)
anova(obj1,obj,test="F")
#also see the "Approximate significance of smooth terms" summary(obj)

Donal O'Neill wrote:
> I have estimated a multiple nonparametric regression using the loess
> command in R. I have also estimated an additive version of the model using
> the gam function. Is there a way of using the output of these two models to
> test the restrictions imposed by the additive model?
>
> ______________________________________________
> 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
> and provide commented, minimal, self-contained, reproducible code.
>
>

-- 
====================================
Vito M.R. Muggeo
Dip.to Sc Statist e Matem `Vianelli'
UniversitÓ di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 6626240
fax: 091 485726/485612

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.
Received on Tue Apr 03 19:50:29 2007

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 Tue 03 Apr 2007 - 17:30:55 GMT.

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