# NOT RUN {
# Hosmer, D. (2013) page 3: Age and coranary Heart Disease (CHD) Status of 20 subjects:
AGE <- c(20, 23, 24, 25, 25, 26, 26, 28, 28, 29, 30, 30, 30, 30, 30, 30, 30, 32, 33, 33)
CHD <- c(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0)
data <- data.frame (CHD, AGE)
lsm(CHD ~ AGE , family = binomial, data)
# Other case.
y <- c(1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1)
x1 <- c(2, 2, 2, 5, 5, 5, 5, 8, 8, 11, 11, 11)
data <- data.frame (y, x1)
ELAINYS <-lsm(y ~ x1, family=binomial, data)
summary(ELAINYS)
## For more ease, use the following notation.
lsm(y~., family = binomial, data)
## Other case.
y <- as.factor(c(1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1))
x1 <- as.factor(c(2, 2, 2, 5, 5, 5, 5, 8, 8, 11, 11, 11))
data <- data.frame (y, x1)
ELAINYS1 <-lsm(y ~ x1, family=binomial, data)
confint(ELAINYS1)
## For more ease, use the following notation.
lsm(y~. , family = binomial, data)
# }
Run the code above in your browser using DataLab