[R] How to plot effect of x1 while controlling for x2

2010-11-15 Thread Mark Na
Hello R-helpers, Please see a self-contained example below, in which I attempt to plot the effect of x1 on y, while controlling for x2. Is there a function that does the same thing, without having to specify that x2 should be held at its mean value? It works fine for this simple example, but

Re: [R] How to plot effect of x1 while controlling for x2

2010-11-15 Thread Joshua Wiley
Hi Mark, If the cumbersome part is that you have to create new data to use predict, then I think the answer is no, there is not an easier way. However, we can consider easy ways to make new data that fit with certain constraints (e.g., variables = their mean). Here's an example: ## original

Re: [R] How to plot effect of x1 while controlling for x2

2010-11-15 Thread Greg Snow
Look at Predict.Plot (and TkPredict) from the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On

Re: [R] How to plot effect of x1 while controlling for x2

2010-11-15 Thread Bert Gunter
... and/or perhaps ?coplot in base R graphics or ?xyplot in trellis. -- Bert Gunter On Mon, Nov 15, 2010 at 2:25 PM, Greg Snow greg.s...@imail.org wrote: Look at Predict.Plot (and TkPredict) from the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center