Hi,

Using the latest rms package I am able to make nice plots of model predictions 
+/- desired confidence intervals like this:

# need this
library(rms)

# setup data
d <- data.frame(x=rnorm(100), y=rnorm(100))
dd <- datadist(d)
options(datadist='dd')

# fit model
l <- ols(y ~ rcs(x), data=d)

# predict along original limits of data
l.pred <- Predict(l)

# plot of fit and conf. int.
xYplot(Cbind(yhat, lower, upper) ~ x, data=l.pred, method='filled', 
col.fill=grey(0.9), col=1, type='l')

Is there any way in which I can turn this figure on its side, by plotting x ~ 
y... something like this:

# doesn't work
xYplot(x ~ Cbind(yhat, lower, upper), data=l.pred, method='filled', 
lable.curves=FALSE, col.fill=grey(0.9), col=1, type='l')

# standard lattice, but without the fancy filled area
xyplot(x ~ yhat + lower + upper, data=l.pred, type='l', lty=c(1,2,2), col=1)

Any suggestions? If it is not possible, then I will try and manually make the 
figure with basic lattice functions.

Cheers,
Dylan


-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341

______________________________________________
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