ppreg(x, y, min.term, max.term=min.term, wt=rep(1, nrow(x)), rwt=rep(1, ncol(y)), xpred=NULL, optlevel=2, bass=0, span="cv")
The chapter "Regression and Smoothing for Continous Response Data" in the S-PLUS Guide to Statistical and Mathematical Analysis.
x1 <- rnorm(100) ; x2 <- rnorm(100) ; eps <- rnorm(100, 0, .1) x <- matrix(c(x1, x2), 100, 2) y <- x1*x2 + eps # Set up a matrix of predictor values. xpred <- matrix(c(0, 0, 0, 1, 1, 0, 1, 1), 4, 2, byrow=T) # Use ppreg with unit weights for both the observations and # the response, and a 2 term regression model (picked from 3 terms). a <- ppreg(x, y, 2, 3, xpred=xpred)# Plot the function values versus their abscissas, to look for structure. matplot(a$z, a$zhat)