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

From: apeer <adamcpeer_at_gmail.com>
Date: Tue, 19 Apr 2011 11:53:13 -0700 (PDT)


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)

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

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.


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.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 19 Apr 2011 - 19:56:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 19 Apr 2011 - 20:10:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive