Here is a starter example that calls on the invariance of MLEs under transformation.
Exercise 7.54
For the birthweight example, suppose that of real interest is the
effect on birthweight of a baby being born 3 weeks early compared to
the usual 40 weeks. On average, how much lighter would you expect such a baby to be?
In general, suppose we have the maximum likelihood estimate for some quantity denoted as and a confidence interval (, ). The maximum likelihood estimate and corresponding confidence interval for some increasing monotonic function is obtained by applying the transformation to both quantities: and . For a decreasing monotonic function, the limits of the confidence interval are reversed.
Exercise 7.55
Consider the AIDS data example, for which we modelled using a Poisson regression where the expected number of AIDS deaths in a given 3 month time period is . Suppose we are interested in the average percentage increase in number of deaths from one time point to the next.
Find a confidence interval for this quantity.
Suppose that we have a parameter vector . Let denote the vector of maximum likelihood estimates with variance-covariance matrix . We are interested in estimating some function of these coefficients, say . By invariance, the MLE is . Determination of the confidence interval for needs careful consideration as there is likely to be dependence between the coefficients.
(Delta method) For some transformation , define the vector of partial derivatives of with respect to the parameters as:
The transformation can be approximated by the first two terms of the Taylor series around some value :
where the vector of derivatives are evaluated at . The variance of the transformation is then approximated by:
where is the variance-covariance matrix of the parameter vector .
It follows from the delta method that the standard error of the transform is:
and the corresponding 100% asymptotic confidence interval is:
Note: Suppose that where is a linear combination of the model parameters , and that is a simple monotonic transformation of . Then it is best to apply the above method to obtain a confidence interval for and then translate this into a confidence interval for .
The data set in analgesic comes from a clinical trial that compares four analgesics; Amidone, Morphine, Pethidine and Phenadoxone. Figure 7.1 (Link) presents a scatter plot of the proportion of patients who recorded pain relief against the log-dosage of the drug they received.
Model
Let be the proportion with pain relief, the number of patients for each dose/drug combination, and the log dose. The obvious model is where is the (unknown) probability of pain relief.
Suppose that the logit of the probability changes linearly with log-dose, whatever the drug, but the drug affects the intercept. This defines the main effects model with numerical log-dose and categorical drug explanatory variable. Mathematically this model is
where are indicator vectors for drugs ‘Mo’rphine, ‘Pe’thidine and ‘Ph’enadoxone, and defines the log-dose. Note that the drug Amidone is taken as the baseline case and the co-efficients , and represent in intercept change in the linear predictor for each respective drug on top of the baseline case.
Fitting this model in R:
analgesic <- read.table("analgesic.dat") mod1 <- glm(cbind(number, total-number) ~ 1 + ldose + drug, family=binomial(link = "logit"), data = analgesic) summary(mod1)
This summary returns:
Deviance Residuals: Min 1Q Median 3Q Max -0.78625 -0.50404 0.04222 0.46554 1.13291 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -1.8933 0.2033 -9.312 < 2e-16 *** ldose 4.0616 0.2973 13.663 < 2e-16 *** drugMo -0.3921 0.1801 -2.177 0.0295 * drugPe -2.3275 0.2333 -9.977 < 2e-16 *** drugPh 1.8515 0.2294 8.071 6.96e-16 *** --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 249.9579 on 13 degrees of freedom Residual deviance: 4.2588 on 9 degrees of freedom AIC: 79.48
Exercise 7.56
Write down the estimated fitted means and probabilities,
for each of the drugs.
The fitted logistic curves for each drug is depicted in Figure 7.1 (Link). From the fitted curves, we see that:
There is a difference in relief: ordering Ph,Am,Mo,Pe.
The ‘shape’ of the fitted curves are the same, only shifted.
A unit increase in log-dose produces a common 4.06 logit rise in pain relief.
Compare the effects of drugs Phenadoxone and Morphine. For a given log-dosage , the linear predictor for each drug are:
The difference between these effects are:
Exercise 7.57
Provide an interpretation for the difference .
Exercise 7.58
Calculate the Phenadoxone to Morphine odds ratio and calculate the corresponding 95% confidence interval.
Note that is:
vcov(mod1) (Intercept) ldose drugMo drugPe drugPh (Intercept) 0.0413 -0.0454 -0.0175 0.0052 -0.0362 ldose -0.0454 0.0884 -0.0011 -0.0453 0.0354 drugMo -0.0175 -0.0011 0.0324 0.0186 0.0176 drugPe 0.0052 -0.0453 0.0186 0.0544 -0.0001 drugPh -0.0362 0.0354 0.0176 -0.0001 0.0526