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

Frank E Harrell Jr f.harrell at vanderbilt.edu
Tue Sep 8 14:39:49 CEST 2009


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 numeric predictor, and use 
> forceLines=TRUE, plot is not nice and true, since it shows values 
> between 1 and 2.
> 
> Thanks!
> PM
> 

Petar,

forceLines seems to be doing what it was intended to do.  I'm not clear 
on why you need a line, though.  If you provide self-contained code and 
data that replicate your problem I may be able to help more, or you can 
try a new package I'm about to announce.

Frank
-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list