Description Usage Format Source References Examples

The `birthwt`

data frame has 189 rows and 10 columns.
The data were collected at Baystate Medical Center, Springfield, Mass
during 1986.

1 |

This data frame contains the following columns:

`low`

indicator of birth weight less than 2.5 kg.

`age`

mother's age in years.

`lwt`

mother's weight in pounds at last menstrual period.

`race`

mother's race (

`1`

= white,`2`

= black,`3`

= other).`smoke`

smoking status during pregnancy.

`ptl`

number of previous premature labours.

`ht`

history of hypertension.

`ui`

presence of uterine irritability.

`ftv`

number of physician visits during the first trimester.

`bwt`

birth weight in grams.

Hosmer, D.W. and Lemeshow, S. (1989)
*Applied Logistic Regression.* New York: Wiley

Venables, W. N. and Ripley, B. D. (2002)
*Modern Applied Statistics with S.* Fourth edition. Springer.

1 2 3 4 5 6 7 8 9 10 | ```
bwt <- with(birthwt, {
race <- factor(race, labels = c("white", "black", "other"))
ptd <- factor(ptl > 0)
ftv <- factor(ftv)
levels(ftv)[-(1:2)] <- "2+"
data.frame(low = factor(low), age, lwt, race, smoke = (smoke > 0),
ptd, ht = (ht > 0), ui = (ui > 0), ftv)
})
options(contrasts = c("contr.treatment", "contr.poly"))
glm(low ~ ., binomial, bwt)
``` |

```
Call: glm(formula = low ~ ., family = binomial, data = bwt)
Coefficients:
(Intercept) age lwt raceblack raceother smokeTRUE
0.82302 -0.03723 -0.01565 1.19241 0.74068 0.75553
ptdTRUE htTRUE uiTRUE ftv1 ftv2+
1.34376 1.91317 0.68020 -0.43638 0.17901
Degrees of Freedom: 188 Total (i.e. Null); 178 Residual
Null Deviance: 234.7
Residual Deviance: 195.5 AIC: 217.5
```

MASS documentation built on Nov. 1, 2018, 5:06 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.