Sure, I am creating a partial dependence plot (reference Friedman's
stochastic gradient paper from, I want to say, 2001).  The idea is to find
the relationship between one of the predictors, say x1, and y by creating
the following plot: take a random sample of actual data points, hold other
predictors fixed (x2-xp), vary x1 across its range, create a string of
predictions for each value of x1, repeat for all observations in sample, and
finally average all the predictions for each value of x1.  If you think
about it, this plot solves Simpson's paradox under fairly mild conditions.

The code I wrote does this using predict() which is useful for modeling
approaches like GAMs.

Mike


On Wed, Apr 23, 2008 at 8:47 PM, hadley wickham <h.wickham@gmail.com> wrote:

> On Wed, Apr 23, 2008 at 7:31 PM, Mike Dugas <mikedugas77@gmail.com> wrote:
> > Thanks for the help.  That explains why my time testing showed no
> > difference.  Is there any way to speed up the program?  It is unbearably
> > slow if I increase the number of loops.
>
> Could you explain exactly what you're trying to do with your code?
> It's a little hard to understand.
>
> Hadley
>
>
> --
> http://had.co.nz/
>

	[[alternative HTML version deleted]]

