Re: [R] Very basic question regarding plot.Design...

2009-09-09 Thread Frank E Harrell Jr
I just added a new option nlines to plot.Predict to make it easy to get interaction line plots for categorical predictors. To get the new version type the following after running require(rms): source('http://biostat.mc.vanderbilt.edu/tmp/plot.Predict.s') Here are some examples: require(rms)

Re: [R] Very basic question regarding plot.Design...

2009-09-09 Thread Frank E Harrell Jr
Petar Milin wrote: Sorry, I hope this will be the last (for now, at least). Following your advices, I did: n <- 100 anxiety <- c(rnorm(n, 10, 2.5), rnorm(n, 26, 3.2), rnorm(100, 25, 3.1), rnorm(100, 10, 2.6)) m.status <- c(rep('married', n*2), rep('not married', n*2)) gender <- c(rep('mal

Re: [R] Very basic question regarding plot.Design...

2009-09-09 Thread Petar Milin
Sorry, I hope this will be the last (for now, at least). Following your advices, I did: n <- 100 anxiety <- c(rnorm(n, 10, 2.5), rnorm(n, 26, 3.2), rnorm(100, 25, 3.1), rnorm(100, 10, 2.6)) m.status <- c(rep('married', n*2), rep('not married', n*2)) gender <- c(rep('male', n), rep('female'

Re: [R] Very basic question regarding plot.Design...

2009-09-09 Thread Frank E Harrell Jr
Petar Milin wrote: Thank you very much for the help! Now, I have an additional question regarding transcending from Design to rms: Before, it was possible to plot interaction, and get lines with plot(ols2, gender=NA, marital.status=NA, xlab='gender', ylab='anxiety', conf.int=FALSE) Now, I

Re: [R] Very basic question regarding plot.Design...

2009-09-09 Thread Petar Milin
Thank you very much for the help! Now, I have an additional question regarding transcending from Design to rms: Before, it was possible to plot interaction, and get lines with plot(ols2, gender=NA, marital.status=NA, xlab='gender', ylab='anxiety', conf.int=FALSE) Now, I am lost how to do t

Re: [R] Very basic question regarding plot.Design...

2009-09-08 Thread Frank E Harrell Jr
Petar Milin wrote: I would like to have a line on this plot, instead of two points: x1 = rnorm(100, 10, 2.5) x2 = rnorm(100, 26, 3.2) x1 = as.data.frame(x1) x2 = as.data.frame(x2) colnames(x1) = 'anxiety' colnames(x2) = 'anxiety' x1$gender = 'male' x2$gender = 'female' dat = rbind(x1, x2) requi

Re: [R] Very basic question regarding plot.Design...

2009-09-08 Thread Frank E Harrell Jr
Petar Milin wrote: Hello ALL! I have a problem to plot factor (lets say gender) as a line, or at least both line and point, from ols model: ols1 <- ols(Y ~ gender, data=dat, x=T, y=T) plot(ols1, gender=NA, xlab="gender", ylab="Y", ylim=c(5,30), conf.int=FALSE) If I convert gender into discrete