[R] the observed "log odds" in logistic regression

Frank E Harrell Jr f.harrell at vanderbilt.edu
Tue Dec 11 09:28:40 CET 2007


Bernardo Rangel Tura wrote:
> On Mon, 2007-12-10 at 19:42 -0800, Bin Yue wrote:
> (...)
>>    My problem  is this : in my data set , the IVs are continuous variables,
>> do I still have to generate such a table and compute the log odds for each
>> level of IV according to which the log odds are calculated?  
> 
> If IV is a continuous variable isn't possible you create a contingency
> table because don't exist levels.
> 
> Similar is not possible calculate de log odds of P(IV=x) but is possible
> calculate log odds of P(IV<x) or log odds of P(IV=x+delta) with delta
> tend to zero. 

Incorrect.  You can easily create the log odds for IV=x1 vs. IV=x2

> 
> In this case is common create a cut-off for IV and fit log odds of
> P(IV>x)

Not needed, and if you do, the resulting odds ratios are actually no 
longer scientific quantities of interest, i.e., they have no exact 
interpretation outside your sample of x's.  They are averaged over an 
unspecified distribution of x's.

Frank

> 
>>    In R , fitted(fit) gives the fitted probability for DV to be 1.  Dose the
>> observed probability exist ? If it does exist , how can I extract it ? If
>> the IV is cartegorical , the DV can readily changed to be a tow-culumned
>> matrix, thus log(the observed probabily/(1-the observed probability) might
>> be the "log odds". I wonder what if the IV is continuous ?
>>      And about the residuals. It seems that  the residual is not the actual
>> DV minus the fitted probability. For in my model extreme residuals lie well
>> beyond (0,1).  I wonder how   the residual is computed.
>>       Would you please help me ?  Thank all very much again.
> 
> So to help you send a small part of your data and a reproductive example
> to us because is more easy understand your question this way


-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University



More information about the R-help mailing list