Lecture Notes on Binomial Data: Binary Data | MATH 6080, Study notes of Mathematics

Material Type: Notes; Class: App Linear Stat Meth II; Subject: MATH Mathematics; University: Tennessee Tech University; Term: Unknown 1989;

Typology: Study notes

Pre 2010

Uploaded on 07/30/2009

koofers-user-na4
koofers-user-na4 🇺🇸

1

(1)

10 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Binomial Data - continued
2.6 Binary Data
The extreme case of a binomial response where responses are just binary (i.e. Bernoulli
random variables - which are binomial with n= 1) gives rise to some unique issues.
Example A study of 757 female Pima Indians in Phoenix, Arizona examined risk factors
for diabetes. We will only consider a few of these risk factors in modeling the response
variable test which is 1 if diabetes was present in a single observation and 0 otherwise. SAS
implementation of this study is found in pima logistic.sas. The variables we will look at
in this example are
1. age - measured in years.
2. bmi - body mass index which is calculated as weight[kg]/height2[m].
3. pregnant - also known in this type of research as parity - this variable represents the
number of pregnancies (not necessarily those leading to births).
A few summary statistics on the data (generated by PROC MEANS).
Diabetes among Pima Indians
Statistic test age pregnant bmi
Min 0 21 0 18.20
Q1 0 24 1 27.50
Med 0 29 3 32.30
Q3 1 41 6 36.60
Max 1 81 17 67.10
Note:
The predictors include continuous measurements (i.e. age and bmi).
There are only a few individuals out of 757 that share the same values of these predic-
tors.
Only 3 women share the same levels on all three levels.
Consequence - it does not make sense to group the individuals for identical values of
the predictors. (We were able to do this in the budworm example.)
The plots of the response against the covariates are quite difficult to analyze.
In pima logistic.sas take a look at the following plots:
1. test*bmi=test - it appears that as bmi increases there may be an increase in the
onset of diabetes.
1
pf3
pf4
pf5

Partial preview of the text

Download Lecture Notes on Binomial Data: Binary Data | MATH 6080 and more Study notes Mathematics in PDF only on Docsity!

Binomial Data - continued

2.6 Binary Data

The extreme case of a binomial response where responses are just binary (i.e. Bernoulli random variables - which are binomial with n = 1) gives rise to some unique issues.

Example A study of 757 female Pima Indians in Phoenix, Arizona examined risk factors for diabetes. We will only consider a few of these risk factors in modeling the response variable test which is 1 if diabetes was present in a single observation and 0 otherwise. SAS implementation of this study is found in pima logistic.sas. The variables we will look at in this example are

  1. age - measured in years.
  2. bmi - body mass index which is calculated as weight[kg]/height^2 [m].
  3. pregnant - also known in this type of research as parity - this variable represents the number of pregnancies (not necessarily those leading to births).

A few summary statistics on the data (generated by PROC MEANS).

Diabetes among Pima Indians Statistic test age pregnant bmi Min 0 21 0 18. Q1 0 24 1 27. Med 0 29 3 32. Q3 1 41 6 36. Max 1 81 17 67.

Note:

  • The predictors include continuous measurements (i.e. age and bmi).
  • There are only a few individuals out of 757 that share the same values of these predic- tors.
  • Only 3 women share the same levels on all three levels.
  • Consequence - it does not make sense to group the individuals for identical values of the predictors. (We were able to do this in the budworm example.)
  • The plots of the response against the covariates are quite difficult to analyze.
  • In pima logistic.sas take a look at the following plots:
    1. test*bmi=test - it appears that as bmi increases there may be an increase in the onset of diabetes.
  1. test*pregnant=test - it is difficult here to see if the number of pregnancies has an impact on diabetes.
  2. test*age=test - similar difficulty here as with the number of pregnancies.

2.6.1 Analysis of Binary Data

The implementation for binary data is very similar to that of binomial data (where n > 1). A piece of the SAS code for implementing a logistic regression model of the form

logit(π) = β 0 + β 1 bmi + β 2 age + β 3 pregnant

is found below.

proc logistic descending data=pima; model test = bmi age pregnant; run;

Note:

  • Recall that we are modeling the presence of diabetes.
  • For test = 1, an observation has been diagnosed with diabetes.
  • We still need the descending option, otherwise, SAS will model the absence of dia- betes.
  • We can put the response test directly in the model with no modifications.
  • You can think of this as dividing y in the budworm example by n = 1.
  • All other commands carry forward as with the budworm example.

We can examine the parameter estimates below.

Analysis of Maximum Likelihood Estimates

Parameter DF Estimate Std Error Wald Chi-Sq Pr > ChiSq Intercept 1 -5.7052 0.5427 110.5095 <. bmi 1 0.1093 0.0132 68.4079 <. age 1 0.0331 0.0082 16.3239 <. pregnant 1 0.0853 0.0284 9.0008 0.

Parameter interpretation

  • All variables in the model are statistically significant - indicating risk factors for dia- betes.
  1. Failing to reject the null statistically supports the removal of the predictors in the larger model.
  2. Two possible test statistics based on D∗^ are

X^2 = D∗(M 1 ) − D∗(M 0 ) ∼ χ^2 (p−q)

F =

D∗(M 1 ) − D∗(M 0 )

p − q

∼ F( df 1 = p−q, df 2 = n−p )

  1. The main difference between the X^2 and F lies in how to account for the estima- tion of the dispersion parameter φ.
  • Testing H 0 : β = 0 for a single predictor. Same as for binary day and exemplified in the budworm data. All parameter estimates in the current model for Pima are individually statistically significant.
  • Hosmer-Lemeshow Test - The test statistic of 27.9 with 9 degrees of freedom results in a p-value of .0005. For this test, we reject the null hypothesis that the model fits the data adequately. This may indicate the need for transformations in the predictors, additional predictors, and possibly interaction terms.

2.6.3 Checks for Systematic Departures from the Model

Residual Patterns - Residuals for binary data are some of the most difficult to interpret because of the dichotomous nature of the response. These plots - for the most part - are noninformative. Probability plots based on the residuals for binary data are also noninfor- mative. Examples of these are included only for demonstration.

Systematic Departures in the Link Function

  • Informal Checks Using Residuals:
    1. resid*logit hat - The residuals for “0” (no diabetes) lie above zero while the residuals for “1” (diabetes) lie above the zero. This is about what we would expect for binary data - and by itself does not indicate a poor fit. Locally the residuals should average zero. For this pattern, we have confirmation of the model overpredicting diabetes for lower predicted logits.
    2. devresid*logit hat - Same (uninformative) pattern.
    3. resid*pred - The residuals plotted against the predicted probabilities is convey- ing the same information as the previous plot.
    4. devresid*pred - Same as above.
  • Formal Checks on the Link Function - For the model

logit(π) = β 0 + β 1 bmi + β 2 age + β 3 pregnant + β 4 logithat 2

we notice that the square of the link function is significant - the Wald test for β 4 indi- cates a statistical difference from zero. This could indicate an incorrect link function, incorrect transformation on the predictor variables, or the omission of an important predictor. This may also be the reason that the Hosmer-Lemeshow test re- jected the fit.

Systematic Departures in the Scale of the Covariates

  • logit hat*bmi - linear relationship seems reasonable.
  • logit hat*pregnant - linear relationship seems plausible - but possible improvement might be made with a transformation.
  • logit hat*age - possible improvements to the model fit could be made here. It looks like a transformation on age may provide a better fit with the logit.
  • resid*(omitted predictors) - no clear indication that we have omitted potential predictors in the model. One may try adding glucose to the model.

Systematic Checks in the Variance Function

The plot absresid*logit hat is noninformative.

2.6.4 Checks for Isolated Departures from the Model

The same procedures for binomial data are implemented for binary data. In general, datasets with a binary response tend to be rather large. Thus, calling the influence routine after the model statement in proc logistic could generate an exorbitant amount of output. Instead, we will output the same information to a file from which we will generate univariate summaries and plots as follows:

proc logistic descending data=pima; model test = bmi age pregnant; output out=resdata3 h = leverage resdev=deviance resid c=cooksdist; run;

proc univariate data=resdata3 plots nextrobs=40; var cooksdist deviance resid leverage; run;

proc plot data=resdata3; plot (leverage deviance resid cooksdist)*id; run;