[R] supsmu vs. ppr

Thomas Lumley tlumley at u.washington.edu
Mon Feb 12 22:04:18 CET 2001


On Mon, 12 Feb 2001 david.beede at mail.doc.gov wrote:

> I used the supersmoother function in the modreg package as follows:
> 
> super <- supsmu(ilogemp,award)
> 
> Then I decided that I might want additional explanatory variables (other
> than ilogemp) in my model.  The ppr function in modreg seemed a logical
> extension of supsmu from univariate to multidimensional explanatory
> variables.  As a "check" I ran the following:
> 
> pprest <- ppr(ilogemp,award,nterms=1),
> 
> figuring I'd get the same results.  I did not.  First, the fitted values
> ppr output is not rescaled back to the original scale of award.
> Eventually, I figured out that the ppr fitted values had mean zero and
> variance=1, so I thought I needed to multiply ppr's fitted values by the
> standard deviation of award (pprest$ys) and then add in the mean of award
> (pprest$yb), but the result is still way off from the fitted values from
> supsmu.


I don't get this at all.  I used the rock data in example(ppr)
and did

 plot(perm~area1,data=rock)

 a.ppr<-ppr(perm~area1,data=rock,nterms=1)
 points(area1,fitted(a.ppr),col=2)
 lines(supsmu(rock$perm,rock$area1),col=3)
 b.ppr<-ppr(area1,rock$perm,nterms=1)
 points(area1,fitted(b.ppr),col=4)

The two ppr() sets of fitted values were identical, and the supsmu() line
followed them very closely.  In addition, the variance of the fitted
values is about 44000, not 1, and the mean is 415, not 0.

One difficulty in comparing the fitted values (which is I did it
graphically) is that supsmu() returns its results for the unique x values
sorted in increasing order and ppr() doesn't.


	-thomas


Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list