[R] Testing additive nonparametric model

Donal O'Neill donal.oneill at nuim.ie
Tue Apr 3 18:38:58 CEST 2007

   Dear Vito,
   Thank you for your prompt reply. Perhaps I am missing something but as
   I  understand  it the procedure you suggest would allow me to test for
   nonlinearities  in  one of the control variables. However my objective
   is to nonparametrically test whether the nature of the nonlinearity in
   one  variable  is  constant across all values of a second conditioning
   variable.  That is I want to test y=f(x1,x2)+e against y=f1(x1)+f2(x2)
   + u
   I tried
   mod.2<-loess(y~x1+x2, f=**, iter=**), lwd=**)
   anova(mod.1, mod.2)
   but got the following error message
   Error in s^2 : non-numeric argument to binary operator
   Any suggestions would be welcome.
   At 11:43 03/04/2007 +0200, vito muggeo wrote:

     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..
     x0 <- runif(n, 0, 1)
     x1 <- runif(n, 0, 1)
     y <- sin(2*pi*x0) + .5*x1 +sig*rnorm(n)
     #also see the "Approximate significance of smooth terms"
     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 at stat.math.ethz.ch mailing list
     PLEASE do read the posting guide
     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


   1. https://stat.ethz.ch/mailman/listinfo/r-help
   2. http://www.r-project.org/posting-guide.html

More information about the R-help mailing list