Re: [R] Manually Calculating Odds from POLR Model

From: Tate Avery <tate_sterling_avery_at_hotmail.com>
Date: Tue 16 Aug 2005 - 06:57:48 EST


John,

Thank you, the document was very helpful. I can now calculate the same values generated by predict() when I am using purely numeric input data.

Another small question arises when I look at the example using 'housing' in the polr() documentation page:

Running the example produces the following coefficients...

Coefficients:

   InflMedium InflHigh TypeApartment TypeAtrium TypeTerrace ContHigh

    0.5663924 1.2888218 -0.5723552 -0.3661912 -1.0910195 0.3602834

Now, if I am trying to perform a prediction and the value for INFL comes in as 'Medium' what is done? And, what is done for 'low'?

That seems to be the last missing piece in my understanding of how to convert the model values into predictions.

Thank you,
Tate

>From: "John Fox" <jfox@mcmaster.ca>
>To: "'Tate Avery'" <tate_sterling_avery@hotmail.com>
>CC: <r-help@stat.math.ethz.ch>
>Subject: RE: [R] Manually Calculating Odds from POLR Model
>Date: Fri, 12 Aug 2005 19:22:23 -0400
>
>Dear Tate,
>
>If I understand correctly what you're asking, the formulas are on p. 21 of
>the paper at
><http://socserv.socsci.mcmaster.ca/jfox/Papers/logit-effect-displays.pdf>.
>But why do you want to do this when you can get the fitted probabilities
>from predict()?
>
>I hope this helps.
> John
>
>--------------------------------
>John Fox
>Department of Sociology
>McMaster University
>Hamilton, Ontario
>Canada L8S 4M4
>905-525-9140x23604
>http://socserv.mcmaster.ca/jfox
>--------------------------------
>
> > -----Original Message-----
> > From: r-help-bounces@stat.math.ethz.ch
> > [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Tate Avery
> > Sent: Friday, August 12, 2005 2:50 PM
> > To: r-help@stat.math.ethz.ch
> > Subject: [R] Manually Calculating Odds from POLR Model
> >
> > Hello,
> >
> > I am using polr(...) to generate a model. The summary shows
> > the coefficients and the intercepts.
> >
> > For example:
> >
> > coefficient for x1 = c1
> > coefficient for x2 = c2
> >
> > intercept A|B = i1
> > intercept B|C = i2
> >
> > I can then run predict(..., type="p") with the model and see
> > the odds for each factor.
> >
> > For example:
> >
> > A B C
> > 1 0.3 0.5 0.2
> > 2 0.4 0.1 0.5
> >
> > What I really want to be able to do is take the 2
> > coefficients, the 2 intercepts, the x1 & x2 values and
> > manually calculate the probabilities generated by predict().
> >
> > I have been searching quite extensively for the underlying
> > calculations that transform the polr output and the input
> > variables into the final output odds. I have tried a number
> > of dead-end roads so far.
> >
> > So, if anyone has any information on how to do this or where
> > I can find out, I would be extremely grateful.
> >
> > Thank you for your time,
> > Tate Avery
> >
> > ______________________________________________
> > 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
>



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 Tue Aug 16 07:03:38 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:49 EST