

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















Lets begin with a simple example. Suppose that we are interested in studying the likelihood of an individual getting lung cancer. We measure a variety of variables for each individual, including age, gender, number of cigarettes smoked per day, etc. For each individual, we also measure if the person develops lung cancer (we cannot actually measure their chances of getting it).
In this case, we have a binary response variable,
Yi =
0 , if the individual does not develop cancer, 1 , if the individual does develop cancer.
In this case, Yi is a Bernoulli random variable with
pr(Yi = 1) = pi and pr(Yi = 0) = 1 − pi.
It is easy to see that E(Yi) = pi and var(Yi) = pi(1 − pi). Thus, we have a situation where the variance of the response is a function of the mean.
This is a situation which we have not previously consid- ered, but obviously causes problems with linear or non- linear regression. Both of those methods assume that the errors are independent and identically distributed, which cannot be true of they are a function of the mean.
Typically in studies of this form, we will want to relate the mean, pi (probability of developing cancer) to some explanatory variables xi. One possible way to do this is using a logistic regression model.
The form of a logistic regression is
pi = f (xi; θ) =
exp(x′ iθ) 1 + exp(x′ iθ)
There are several things to note about this form: 0 ≤ pi ≤ 1, for all θ and xi. Second, notice that this curve has a sigmoidal shape. To see this, let’s draw the shape for a single regressor xi.
We could equivalently write the logistic regression model by
logit(pi) = log
pi 1 − pi
= x′ iθ.
Here the form pi/(1 − pi) is called the odds. Intuitively, if pi = .8, then the odds is. 8 /.2 = 4, and we are four times more likely to be a 1 than a 0.
Additionally, notice that this form for the model high- lights the fact that a function of the mean response is linear. This is a property common to generalized linear models (and hence the name).
From the likelihood, we can show that
Q(θ) = log{L(θ)} =
∑^ n
i=
Yix′ iθ −
∑^ n
i=
log{1 + exp(x′ iθ)}.
We can maximize this function numerically using the optimization methods which we discussed in nonlinear regression. This will allow us to find the numerical MLE, θˆ.
Additionally, recall the useful property of MLEs that the large sample variance-covariance matrix is just the inverse Fisher Information matrix. Additionally,
θˆ ∼ AN(θ, [I(θ)]−^1 ,
where
I(θ) = E
∂ log{L(θ)} ∂θ
∂ log{L(θ)} ∂θ′
∂ log{L(θ)} ∂θi
∂ log{L(θ)} ∂θj
ij
In some cases, (under some regularity conditions) this is also equivalent to
I(θ) = −E
∂^2 log{L(θ)} ∂θ∂θ′
∂^2 log{L(θ)} ∂θi∂θj
ij
For example, if we consider the model x′ iθ = θ 0 + θ 1 xi, it can be shown that
I(θ) =
i pi(1^ −^ pi)^
∑^ i^ xipi(1^ −^ pi) i xipi(1^ −^ pi)^
i x
2 i pi(1^ −^ pi)
and we could estimate this matrix using I(ˆθ).
Likelihood Ratio Tests:
We can then perform inference on θ based upon likeli- hood ratio tests. Recall, these compare the maximized value of the log-likelihood under both the null hypoth- esis, H 0 , and the unrestricted alternative. If the differ- ence is large, then the unrestricted model fits the data far better and we would reject H 0.
To formulate this test, let θ = [θ′ 1 , θ′ 2 ]′, and assume that we are interested in testing a hypothesis about θ 1. We will leave θ 2 unspecified; we call these parameters nui- sance parameters. Note that both θ 1 and θ 2 can be either a vector or a scalar, and θ 2 can be null.
Suppose that H 0 : θ 1 = θ 1 , 0 , and let ˆθ 2 , 0 be the MLE of θ 2 under the restriction. The likelihood ratio test statistic is given by
−2 log Λ = −2[log{L(θ 1 , 0 , θˆ 2 , 0 ) − L(ˆθ 1 , θˆ 2 )}].
We would reject the null hypotheis, H 0 , when −2 log Λ > χ^2 ν, 1 −α, where ν is the dimension of θ 1.
To understand the interpretation of the parameters, con- sider the simple case of a logistic regression with a single regressor. In this case, the model is
logit(ˆpi) = log
pˆi 1 − pˆi
= ˆθ 0 + ˆθ 1 xi.
Now, consider the value when x = xi + 1. Here,
logit{pˆ(xi + 1)} = ˆθ 0 + ˆθ 1 (xi + 1) = logit{pˆ(xi)} + ˆθ 1.
Next, recall that we called pi/(1 − pi) the odds. Then, notice that we can write
logit{pˆ(xi + 1)} − logit{ˆp(xi)} = log{odds[p(xi + 1)]} − log{o
= log
odds[p(xi + 1)] odds[p(xi)]
= ˆθ 1 ,
and
exp(ˆθ 1 ) =
odds[p(xi + 1)] odds[p(xi)]
the estimated odds ratio.
Then, if the estimate of exp(θ 1 ) is, for example, 2, we would say that the odds of success increase by 100% for each unit increase in the value of x.
Conversely, suppose that the estimate of θ 1 is less than 1, for example, 0.50. This would mean that the odds of success are halved for each unit increase in the value of x.
In general, the estimated odds ratio, when there is a difference of c units in the regressor x, is exp(cθˆ 1.
In general, exp(θk) is the estimated odds ratio for the variable xk, assuming that all of the other variables are held constant.
Inference on a mean response:
Let xh = (1, xh 1 , · · · , xh,p− 1 )′. Then, we have that
ˆph =
exp(x′ hˆθ) 1 + exp(x′ hˆθ)
and s^2 (ˆph) = x′ h[I(ˆθ)]−^1 xh. We could use this informa- tion to form approximate confidence intervals for the mean response in our model.
Additionally, suppose that we want to predict a new observation. We know that the observation must have value either 0 or 1, so we would predict the value of 1 when the estimated probability of success is large, and we would predict a 0 otherwise.
Other Functions:
We might be interested in some function other than the logistic. For example, we might believe that E(Yi) = pi = Φ(x′ iθ), where Φ() is the cdf of a N(0, 1). This is called the probit model. Other such models are also possible, but the logistic and probit are the most com- mon for this situation.
The problem for Poisson regression is actually quite sim- ilar to the logistic regression problem. In fact, we can generalize this to include a vast array of modelling op- tions. These are known as generalized linear models or GLMs.
Exponential Family:
There are many different ways to express the exponen- tial distribution. We are going to consider a special form which is useful for GLMs.
f (y; θ, φ) = exp
θy − b(θ) a(φ)
Here, θ is called the natural parameter and φ is called the dispersion parameter. This family includes the normal distribution, the binomial, the Poisson, the gamma, and the inverse gamma distributions.
Let’s show this for the normal distribution by finding the forms above.
GLM exponential families have the nice properties that
Let’s use this to find the mean and variance for the nor- mal distribution (and compare them to what we know).
We could also do this for another distribution, perhaps for the Poisson distribution.
For the random component:
f (y; θi, φ) = exp
θiy − b(θi) a(φ)
For the systematic component, assume g(μi) = x′ iβ = ηi,
where β = (β 1 , · · · , βp)′. The parameters to be estimated are β 1 , · · · , βp, φ.
The Canonical Link:
If the link function g(·) is such that g(μi) = θi, the natural parameter, then g(·) is called the canonical link.
Examples:
g(μi) = log
μi ni − μi
the logit link.
Estimation:
Estimation of β:
For the random component: Y 1 , · · · , Yn are independent with densities
f (y; θi, φ) = exp
θiy − b(θi) a(φ)
Recall that E(Yi) = μi = b′(θ) and var(Yi) = b′′(θ)a(φ) = V (μi)a(φ). The systematic component is g(μi) = x′ iβ = ηi.
Similarly, we can get expressions for the second deriva- tives. However, if we wish to use a Newton-Raphson algorithm, we really only need
∂^2 `(β, φ) ∂βj∂βk
We can show that this is equal to
∑^ n
i=
wi a(φ)
xijxik,
for the i, jth element.
Then, the “Fisher-score” algorithm for the MLE of β is
β 1 β 2 ... βp
(m+1)
β 1 β 2 ... βp
(m)
∂(β,φ) ∂β 1 ∂(β,φ) ∂β 2 ... ∂`(β,φ) ∂βp
β=β(m)
Note the similarity of this algorithm to the Newton- Raphson algorithm that we discussed earlier.
It is also possible to write this as a weighted least squares problem with weights wi. See McCulloch and Searle,
Notes on a(φ): if a(φ) is a constant or of the form miφ with mi known, then φ cancels.
There are two approaches that we could consider
{θiyi − b(θi)}a′(φ) a^2 (φ)
∂c(yi, φ) ∂φ
and the MLE of φ solves
a^2 (φ) a′(φ)
∑^ n
i=
∂c(yi, φ) ∂φ
∑^ n
i=
{θiyi − b(θi)}.
a(φ) =
var(y) V (μ)
E(y − μ)^2 V (μ)
′− 1 (μ), so the likelihood ration is then
∑^ n
i=
yi{θ(˜μi) − θ(ˆμi)} − b{θ(˜μi)} + b{θ(ˆμi)} ai(φ)
∑^ n
i=
yi(˜θ∗ i − ˆθ∗ i ) − b(˜θ∗ i ) + b(ˆθ∗ i ) ai(φ)
∑^ n
i=
wi{yi(˜θ i∗ − θˆ i∗ ) − b(˜θ∗ i ) + b(ˆθ∗ i )}/φ.
They call this quantity the “scaled deviance”.
∑n i=1 wi{yi(˜θ
∗ i −ˆθ
∗ i )−b(˜θ
∗ i )+ b(ˆθ∗ i )}.
∑n i=1 di.
Let’s find the form of the deviance for a sample from the normal distribution:
Also, let’s do this for a sample from the Poisson distri- bution: