Applied Logistic Regression, Second Edition by Hosmer and Lemeshow Chapter 2: Multiple logistic regression

Figure 1: Hosmer and Lemeshow data on low birthweight

page 32 Table 2.1 An example of the coding of the design variables for race, coded at three levels.

data lowbwt1;
  set 'd:hosmerdatalowbwt';
  if race = 1 then do; race2 = 0; race3 = 0; end;
  if race = 2 then do; race2 = 1; race3 = 0; end;
  if race = 3 then do; race2 = 0; race3 = 1; end;
run;
proc print data=lowbwt1 (obs=3);
var race race2 race3;
run;
Obs    RACE    race2    race3

  1      2       1        0
  2      3       0        1
  3      1       0        0

page 36 Table 2.2 Estimated coefficients for a multiple logistic regression model using the variables
age, weight at last menstrual period (lwt), race and number of first trimester physician
visits from the low birth weight study.

NOTE: We have bolded the relevant output.

proc logistic data=lowbwt1 descending;
  model low = age lwt race2 race3 ftv;
run;
quit;

The LOGISTIC Procedure

Model Information Data Set WORK.LOWBWT1 Response Variable LOW {amp}lt; 2500g Number of Response Levels 2 Number of Observations 189 Link Function Logit Optimization Technique Fisher's scoring

Response Profile

Ordered Total Value LOW Frequency 1 1 59 2 0 130

Model Convergence Status Convergence criterion (GCONV=1E-8) satisfied.

Model Fit Statistics

Intercept Intercept and Criterion Only Covariates AIC 236.672 234.573 SC 239.914 254.023 -2 Log L 234.672 222.573

Testing Global Null Hypothesis: BETA=0

Test Chi-Square DF Pr {amp}gt; ChiSq Likelihood Ratio 12.0991 5 0.0335 Score 11.3876 5 0.0442 Wald 10.6964 5 0.0577

The LOGISTIC Procedure

Analysis of Maximum Likelihood Estimates

Standard Parameter DF Estimate Error Chi-Square Pr {amp}gt; ChiSq Intercept 1 1.2953 1.0714 1.4616 0.2267 AGE 1 -0.0238 0.0337 0.4988 0.4800 LWT 1 -0.0142 0.00654 4.7428 0.0294 race2 1 1.0039 0.4979 4.0660 0.0438 race3 1 0.4331 0.3622 1.4296 0.2318 FTV 1 -0.0493 0.1672 0.0869 0.7681

Odds Ratio Estimates

Point 95% Wald Effect Estimate Confidence Limits AGE 0.976 0.914 1.043 LWT 0.986 0.973 0.999 race2 2.729 1.029 7.240 race3 1.542 0.758 3.136 FTV 0.952 0.686 1.321

Association of Predicted Probabilities and Observed Responses Percent Concordant 65.1 Somers' D 0.308 Percent Discordant 34.3 Gamma 0.310 Percent Tied 0.6 Tau-a 0.133 Pairs 7670 c 0.654

page 38 Table 2.3 Estimated coefficients for a multiple logistic regression model using the variables
lwt and race from the low birth weight study.

proc logistic data=lowbwt1 descending covout outest=lowbwt2;
  model low = lwt race2 race3;
run;
quit;

The LOGISTIC Procedure

Model Information Data Set WORK.LOWBWT1 Response Variable LOW {amp}lt; 2500g Number of Response Levels 2 Number of Observations 189 Link Function Logit Optimization Technique Fisher's scoring

Response Profile

Ordered Total Value LOW Frequency 1 1 59 2 0 130

Model Convergence Status Convergence criterion (GCONV=1E-8) satisfied.

Model Fit Statistics

Intercept Intercept and Criterion Only Covariates AIC 236.672 231.259 SC 239.914 244.226 -2 Log L 234.672 223.259

Testing Global Null Hypothesis: BETA=0

Test Chi-Square DF Pr {amp}gt; ChiSq Likelihood Ratio 11.4129 3 0.0097 Score 10.7572 3 0.0131 Wald 10.1316 3 0.0175

The LOGISTIC Procedure

Analysis of Maximum Likelihood Estimates

Standard Parameter DF Estimate Error Chi-Square Pr {amp}gt; ChiSq Intercept 1 0.8057 0.8452 0.9088 0.3404 LWT 1 -0.0152 0.00644 5.5886 0.0181 race2 1 1.0811 0.4881 4.9065 0.0268 race3 1 0.4806 0.3567 1.8156 0.1778

Odds Ratio Estimates

Point 95% Wald Effect Estimate Confidence Limits LWT 0.985 0.973 0.997 race2 2.948 1.133 7.672 race3 1.617 0.804 3.253

Association of Predicted Probabilities and Observed Responses Percent Concordant 64.1 Somers' D 0.293 Percent Discordant 34.8 Gamma 0.296 Percent Tied 1.1 Tau-a 0.127 Pairs 7670 c 0.647

page 42 Table 2.4 Estimated covariance matrix of the estimated coefficients in Table 2.3.

proc print data=lowbwt2;
  where _type_='COV';
  var _name_ intercept lwt race2 race3;
run;

Obs _NAME_ Intercept LWT race2 race3

2 Intercept 0.71430 -.005213648 0.02260 -0.10350 3 LWT -0.00521 0.000041465 -0.00065 0.00036 4 race2 0.02260 -.000647028 0.23819 0.05320 5 race3 -0.10350 0.000355854 0.05320 0.12722

DescriptionUsageFormatSourceReferencesExamples

Data are from a hypothetical study to evaluate factors associated to low birth weight. This data set contains information
on 488 births to 188 women seen in an obstetrics clinic, comprising 1 to 3 births for each woman and yielding an average of 2.6 births per women.
The outcome binary variable «low» indicates low birth weight defined as birth weight less than 2500 grams. These data are
copyrighted by John Wiley {amp}amp; Sons Inc. and are used here to illustrate the
calculation of prevalence ratios and corresponding confidence intervals.

A data frame with 488 observations on the following 6 variables:

ID

Subject’s identification.

birth

Birth order.

smoke

Smoking Status During Pregnancy (1=Yes, 0= No).

race

Race (1=White, 0= Others).

age

Age of Mother (1= age greater than 35 years, 0= age less or equal to 35 years).

low

Low Birth Weight (1 if birth weight less than 2500 grams, 0 if birth weight greater or equal to 2500 grams).

The data come from
Data courtesy of University of Massachusetts Amherst
(http://www.umass.edu/statdata/statdata/stat-logistic.html)

These data are copyrighted by John Wiley {amp}amp; Sons Inc.
We acknowledged it and use the data to illustrate the methodology included in this library.

Hosmer and Lemeshow (2000) Applied Logistic Regression. New York: Wiley Inter-Science. Second Edition.

Loadingrequiredpackage:bootLoadingrequiredpackage:stats4Loadingrequiredpackage:lme4Loadingrequiredpackage:MatrixLoadingrequiredpackage:HmiscLoadingrequiredpackage:latticeAttachingpackage:'lattice'Thefollowingobjectismaskedfrom'package:boot':melanomaLoadingrequiredpackage:survivalAttachingpackage:'survival'Thefollowingobjectismaskedfrom'package:boot':amlLoadingrequiredpackage:FormulaLoadingrequiredpackage:ggplot2Attachingpackage:'Hmisc'Thefollowingobjectsaremaskedfrom'package:base':format.pval,unitsIDbirthsmokeraceMin.:1.00Min.:1.000Min.:0.0000Min.:0.00001stQu.:46.751stQu.:1.0001stQu.:0.00001stQu.:0.0000Median:93.00Median:2.000Median:0.0000Median:0.0000Mean:93.56Mean:1.873Mean:0.3996Mean:0.14753rdQu.:139.253rdQu.:2.0003rdQu.:1.00003rdQu.:0.0000Max.:188.00Max.:4.000Max.:1.0000Max.:1.0000agelowMin.:0.00000Min.:0.00001stQu.:0.000001stQu.:0.0000Median:0.00000Median:0.0000Mean:0.06762Mean:0.30943rdQu.:0.000003rdQu.:1.0000Max.:1.00000Max.:1.0000

Compare maternal age to baby birth weight:

In[3]:=
ListPlot[ResourceData[{amp}quot;Sample Data: Birth Weight Risk{amp}quot;][{amp}#xA;  All, {{amp}quot;Age{amp}quot;, {amp}quot;BWT{amp}quot;}], AxesLabel -

Automatic]» data-toggle=»tooltip» title=»Copy to Clipboard» tabindex=»0″/{amp}gt;

Out[3]= Applied Logistic Regression, Second Edition by Hosmer and Lemeshow
Chapter 2:  Multiple logistic regression

Description

The data come to us from Hosmer and Lemeshow (2000). Called the low
birth weight (lbw) data, the response is a binary variable, low,
which indicates whether the birth weight of a baby is under 2500g
(low=1), or over (low=0).

Details

lbw is saved as a data frame.
Count models can use ftv as a response variable, or convert it to grouped format

Examples

data(lbw)
glmbwp {amp}lt;- glm(ftv ~ low   smoke   factor(race), family=poisson, data=lbw)
summary(glmbwp)
exp(coef(glmbwp))
library(MASS)
glmbwnb {amp}lt;- glm.nb(ftv ~ low   smoke   factor(race), data=lbw)
summary(glmbwnb)
exp(coef(glmbwnb))

Basic Examples

Retrieve the ResourceObject:

In[1]:=
ResourceObject[{amp}quot;Sample Data: Birth Weight Risk{amp}quot;]
Out[1]= Applied Logistic Regression, Second Edition by Hosmer and Lemeshow
Chapter 2:  Multiple logistic regression

View the data:

In[2]:=
ResourceData[{amp}quot;Sample Data: Birth Weight Risk{amp}quot;]
Out[2]= Applied Logistic Regression, Second Edition by Hosmer and Lemeshow
Chapter 2:  Multiple logistic regression

Visualization

Compare maternal age to baby birth weight:

In[3]:=
ListPlot[ResourceData[{amp}quot;Sample Data: Birth Weight Risk{amp}quot;][{amp}#xA;  All, {{amp}quot;Age{amp}quot;, {amp}quot;BWT{amp}quot;}], AxesLabel -

Automatic]» data-toggle=»tooltip» title=»Copy to Clipboard» tabindex=»0″/{amp}gt;

Out[3]= Applied Logistic Regression, Second Edition by Hosmer and Lemeshow
Chapter 2:  Multiple logistic regression

Format

A data frame with 189 observations on the following 10 variables.

low

1=low birthweight baby; 0=norml weight

smoke

1=history of mother smoking; 0=mother nonsmoker

race

categorical 1-3: 1=white; 2-=black; 3=other

age

age of mother: 14-45

lwt

weight (lbs) at last menstrual period: 80-250 lbs

ptl

number of false of premature labors: 0-3

ht

1=history of hypertension; 0 =no hypertension

ui

1=uterine irritability; 0 no irritability

ftv

number of physician visits in 1st trimester: 0-6

bwt

birth weight in grams: 709 — 4990 gr

References

Hilbe, Joseph M (2007, 2011), Negative Binomial Regression, Cambridge University Press
Hilbe, Joseph M (2009), Logistic Regression Models, Chapman {amp}amp; Hall/CRC

Retrieve the ResourceObject:

In[1]:=
ResourceObject[{amp}quot;Sample Data: Birth Weight Risk{amp}quot;]
Out[1]= Applied Logistic Regression, Second Edition by Hosmer and Lemeshow
Chapter 2:  Multiple logistic regression

Source

Hosmer, D and S. Lemeshow (2000), Applied Logistic Regression, Wiley

Usage

data(lbw)

View the data:

In[2]:=
ResourceData[{amp}quot;Sample Data: Birth Weight Risk{amp}quot;]
Out[2]= Applied Logistic Regression, Second Edition by Hosmer and Lemeshow
Chapter 2:  Multiple logistic regression
Понравилась статья? Поделиться с друзьями:
Website Name