Hi Sheldon,
The problem is that the gam function is not understanding what you
meant with the ^3 term. If you wrap this in an I() function things
will work as you anticipated. See the following:
lsc.gam <- gam(sr~s(I(1/pop15^3))+s(sqrt(pop75))+s(dpi)+s(ddpi),
data=LifeCycleSavings)
plot(lsc.gam)
Note that the s(I(1/pop15^3)) term is going to be very difficult to
interpret here. If you are interested in using a cubic polynomial to
address some nonlinearities you probably want to fit a model with
pop15, pop15^2, and pop15^3 on the right hand side and to then plot
how E[Y|x] changes with pop15 as well as the studentized residuals on
pop15. This will give you some idea of whether this transformation is
capturing the nonlinearities you were seeing.
Best,
Kevin
On Mon, 6 Dec 2004, Sheldon Marshall Bond wrote:
Greetings,
The code I used for the gam function is as follows:
lsc.gam <- gam(sr~s(1/pop15^3)+s(sqrt(pop75))+s(dpi)+s(ddpi)
plot(lsc.gam)
Regards,
Sheldon
On Mon, 6 Dec 2004, Kevin Quinn wrote:
Hi Everyone,
We just realized that January 17 is MLK Day. As a result, the final
exam will now be due at 5pm on Tue. January 18.
Best,
Kevin
------------------------------------------------------
Kevin Quinn
Assistant Professor
Department of Government and
Center for Basic Research in the Social Sciences
34 Kirkland Street
Harvard University
Cambridge, MA 02138
_______________________________________________
gov1000-list mailing list
gov1000-list(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov1000-list