ht01.twoclass: ht01.twoclass data in Package 'HandTill2001'

Description Usage Format Details Source References Examples

Description

two class data and probability predictions thereof.

Usage

1

Format

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

observed

a numeric vector

predicted

a numeric vector

Details

two class data ('observed': MASS::birthwt$low) and probability predictions

(predict(birthwt.step2, type = "response"), cf. Venables and Ripley (2002), pp. 195f and ‘Source’) from stats::glm.

Source

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## From: A two class data example Venables and Ripley pp. 194--199
library(MASS); data("birthwt"); attach(birthwt)
race <- (factor(race, labels = c("white", "black", "other")))
ptd <- factor(ptl > 0)
ftv <- factor(ftv)
levels(ftv)[-(1:2)] <- "2+"
bwt <- data.frame(low = factor(low), age, lwt, race, smoke = (smoke > 0)
	, ptd, ht = (ht > 0), ui = (ui > 0), ftv)
detach(birthwt)
birthwt.glm <- glm(low ~ ., family=binomial(link=logit), data=bwt)
birthwt.step2 <- stepAIC(birthwt.glm, ~ .^2 
			 + I(scale(age)^2) + I(scale(lwt)^2), trace = F )
ht01.twoclass <- data.frame(observed = bwt$low
			    , predicted = predict(birthwt.step2
			    , type = "response"))
write.table(ht01.twoclass, file = "ht01.twoclass.txt")
  

References

Venables, W. N and Ripley, B. D. (2002), Modern Applied Statistics with S (4th edition). Springer, ISBN 0-387-95457-0

Examples

1
2
3

nkola123/kola documentation built on May 23, 2019, 9:05 p.m.