[R] cr.setup & predict with se.fit

apeer adamcpeer at gmail.com
Tue Apr 19 20:53:13 CEST 2011


Hello,

I've recently started using the rms package to fit some continuation ratio
models using cr.setup.  The package runs beautifully and I'm getting good
fits with my data, however, I'm having trouble getting plots of the
predicted mean values of y in relation to predictor variables with
confidence intervals.  Specifically, when I use a function such as L <-
predict(ord.cr, se.fit=TRUE), I get an error command that states: Error in X
%*% cov : non-conformable arguments.  For reference, my model statement (and
as I mentioned above, it fits nicely to my data) and follow-up code looks
something like this :

ord.cr <- lrm(y ~ cohort + a + b, x=TRUE, na.action=na.delete) 

L <- predict(ord.cr, se.fit=TRUE)
plogis(with(L, linear.predictors + 1.96*cbind(-se.fit,se.fit)))

predict(ord.cr, type="fitted.ind")

predict(ord.cr, all.data1.stand, type="fitted")
predict(ord.cr, all.data1.stand, type="fitted.ind")
predict(ord.cr, all.data1.stand, type='mean', codes=TRUE)
m <- Mean(ord.cr, codes=TRUE)
lp <- predict(ord.cr, all.data1.stand)
m(lp)

ddist <- datadist(a, b)
options(datadist='ddist')
m
x11()
plot(Predict(ord.1, a, fun=m), ylim=(0:14), xlab='a', ylab='Predicted mean
y')
options(datadist=NULL)	


Is it possible to use predict to produce such a plot and if not, what is the
best approach?

Thanks for any and all assistance.

Adam

--
View this message in context: http://r.789695.n4.nabble.com/cr-setup-predict-with-se-fit-tp3461236p3461236.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list