Re: [R] plot the dependent variable against one of the predictors with other predictors as constant

2010-08-09 Thread Greg Snow
Look at the TkPredict and Predict.Plot functions in the TeachingDemos package as a couple of options. -- 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

Re: [R] plot the dependent variable against one of the predictors with other predictors as constant

2010-08-08 Thread Bert Gunter
I am thinking about using 'predict' command to generate the prediction of z with the new data.frame but there should be a better way. I'm puzzled. Why would you think that? This is the canonical way to do predictions in R. Bert Gunter Genentech Nonclinical Statistics

[R] plot the dependent variable against one of the predictors with other predictors as constant

2010-08-07 Thread Yi
Hi, folks, Happy work in weekends _ My question is how to plot the dependent variable against one of the predictors with other predictors as constant. Not for the original data, but after prediction. It means y is the predicted value of the dependent variables. The constane value of the other

Re: [R] plot the dependent variable against one of the predictors with other predictors as constant

2010-08-07 Thread Frank Harrell
There are many ways to do this. Here is one. install.packages('rms') require(rms) dd - datadist(x, y); options(datadist='dd') f - ols(z ~ x + y) plot(Predict(f))# plot all partial effects plot(Predict(f, x)) # plot only the effect of x plot(Predict(f, y)) # plot only the effect of y f -