赔率是表达机会的一种方式。 赔率就是:一个赔率除以另一个。 这意味着优势比是您将一个优势乘以另一个而得到的。让我们看看它们在这种常见情况下如何工作。
在赔率和概率之间转换
二进制响应Y的几率是发生(用编码1)Pr(Y=1)发生的机会与没有(用编码0)发生的机会的比率Pr(Y=0):
Odds(Y)=Pr(Y=1)Pr(Y=0)=Pr(Y=1)1−Pr(Y=1).
右边的等价表达式表明,足以对建立模型以找到赔率。相反,请注意,我们可以解决Pr(Y=1)
Pr(Y=1)=Odds(Y)1+Odds(Y)=1−11+Odds(Y).
逻辑回归
逻辑回归将Y的几率对数建模为解释变量的线性函数。最通常,书写这些变量为X 1,... ,X p,并包括在所述线性函数的可能的常数项,我们可以命名的系数(其是要被从数据中估计)为β 1,... ,β p和β 0。正式生成模型Yx1,…,xpβ1,…,βpβ0
log(Odds(Y))=β0+β1x1+⋯+βpxp.
The odds themselves can be recovered by undoing the logarithm:
Odds(Y)=exp(β0+β1x1+⋯+βpxp).
Using categorical variables
Categorical variables, such as age group, gender, presence of Glaucoma, etc., are incorporated by means of "dummy coding." To show that how the variable is coded does not matter, I will provide a simple example of one small group; its generalization to multiple groups should be obvious. In this study one variable is "pupil size," with three categories, "Large", "Medium", and "Small". (The study treats these as purely categorical, apparently paying no attention to their inherent order.) Intuitively, each category has its own odds, say αL for "Large", αM for "Medium", and αS for "Small". This means that, all other things equal,
Odds(Y)=exp(αL+β0+β1x1+⋯+βpxp)
for anybody in the "Large" category,
Odds(Y)=exp(αM+β0+β1x1+⋯+βpxp)
for anybody in the "Medium" category, and
Odds(Y)=exp(αS+β0+β1x1+⋯+βpxp)
for those in the "Small" category.
Creating identifiable coefficients
I have colored the first two coefficients to highlight them, because I want you to notice that they allow a simple change to occur: we could pick any number γ and, by adding it to β0 and subtracting it from each of αL, αM, and αS, we would not change any predicted odds. This is because of the obvious equivalences of the form
αL+β0=(αL−γ)+(γ+β0),
etc. Although this presents no problems for the model--it still predicts exactly the same things--it shows that the parameters are not in themselves interpretable. What stays the same when we do this addition-subtraction maneuver are the differences between the coefficients. Conventionally, to address this lack of identifiability, people (and by default, software) choose one of the categories in each variable as the "base" or "reference" and simply stipulate that its coefficient will be zero. This removes the ambiguity.
The paper lists reference categories first; "Large" in this case. Thus, αL is subtracted from each of αL,αM, and αS, and added to β0 to compensate.
The log odds for a hypothetical individual falling into all the base categories therefore equals β0 plus a bunch of terms associated with all other "covariates"--the non-categorical variables:
Odds(Base category)=exp(β0+β1X1+⋯+βpXp).
No terms associated with any categorical variables appear here. (I have slightly changed the notation at this point: the betas βi now are the coefficients only of the covariates, while the full model includes the alphas αj for the various categories.)
Comparing odds
Let us compare odds. Suppose a hypothetical individual is a
male patient aged 80–89 with a white cataract, no fundal view, and a small pupil being operated on by a specialist registrar, ...
Associated with this patient (let's call him Charlie) are estimated coefficients for each category: α80-89 for his age group, αmale for being male, and so on. Wherever his attribute is the base for its category, the coefficient is zero by convention, as we have seen. Because this is a linear model, the coefficients add. Thus, to the base log odds given above, the log odds for this patient are obtained by adding in
α80-89+αmale+αno Glaucoma+⋯+αspecialist registrar.
This is precisely the amount by which the log odds of this patient vary from the base. To convert from log odds, undo the logarithm and recall that this turns addition into multiplication. Therefore, the base odds must be multiplied by
exp(α80-89)exp(αmale)exp(αno Glaucoma)⋯exp(αspecialist registrar).
These are the numbers given in the table under "Adjusted OR" (adjusted odds ratio). (It is called "adjusted" because covariates x1,…,xp were included in the model. They play no role in any of our calculations, as you will see. It is called a "ratio" because it is precisely the amount by which the base odds must be multiplied to produce the patient's predicted odds: see the first paragraph of this post.) In order in the table, they are exp(α80-89)=1.58, exp(αmale)=1.28, exp(αno Glaucoma)=1.00, and so on. According to the article, their product works out to 34.5. Therefore
Odds(Charlie)=34.5×Odds(Base).
(Notice that the base categories all have odds ratios of 1.00=exp(0), because including 1 in the product leaves it unchanged. That's how you can spot the base categories in the table.)
Restating the results as probabilities
Finally, let us convert this result to probabilities. We were told the baseline predicted probability is 0.736%=0.00736. Therefore, using the formulas relating odds and probabilities derived at the outset, we may compute
Odds(Base)=0.007361−0.00736=0.00741.
Consequently Charlie's odds are
Odds(Charlie)=34.5×0.00741=0.256.
Finally, converting this back to probabilities gives
Pr(Y(Charlie)=1)=1−11+0.256=0.204.