Re: [R] modeling logit(y/n) using lrm

From: Rolf Turner <rolf_at_erdos.math.unb.ca>
Date: Sat 17 Jun 2006 - 03:41:07 EST

Cody Hamilton, Ph.D, wrote:

> I have a dataset at a hospital level (as opposed to the patient
> level) that contains number of patients experiencing events (call
> this number y), and the number of patients eligible for such events
> (call this number n). I am trying to model logit(y/n) = XBeta. In
> SAS this can be done in PROC LOGISTIC or GENMOD with a model
> statement such as: model y/n = <predictors>;. Can this be done using
> lrm from the Hmisc library without restructuring the dataset so that
> for each hospital there is one row with y = 1 and one row with y = 0
> and then using the weight option in lrm to weight these two responses
> by the number of 'successes' and 'failures' for that hospital,
> respectively? I would like to avoid the restructuring, and I
> understand that the use of the weight function is not compatible with
> a lot of the validation functions available in Hmisc (validate,
> bootcov, etc.).

        Why do you need lrm()? Is there something I'm missing?

        As far as I can tell you can simply do

        glm(cbind(y,n-y) ~ <predictors>,family=binomial,data=<data>)

	where ``<data>'' has columns named ``y'' ``n'' and whatever
	the predictors are called.

				cheers,

					Rolf Turner
					rolf@math.unb.ca

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Jun 17 03:45:09 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 17 Jun 2006 - 04:11:52 EST.

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