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 <[EMAIL PROTECTED]> wrote:

> On Wed, Apr 23, 2008 at 7:31 PM, Mike Dugas <[EMAIL PROTECTED]> 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]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to