# NOT RUN {
# simple linear regression models
model1 <- lm(uptake ~ Plant + conc + Plant * conc, data = CO2)
DNbuilder(model1, CO2)
# Generalized regression models
data1 =as.data.frame(Titanic)
model2 <- glm(Survived ~ Age + Class + Sex, data = data1, weights = Freq,
family = binomial("probit"))
DNbuilder(model2, data1, clevel = 0.9)
# a proportional hazard model
data.kidney <- kidney
# always make sure that the categorical variables are in a factor class
data.kidney$sex <- as.factor(data.kidney$sex)
levels(data.kidney$sex) <- c("male", "female")
model3 <- coxph(Surv(time, status) ~ age + sex + disease, data.kidney)
DNbuilder(model3, data.kidney)
DNbuilder(model3, data.kidney, ptype = "1-st")
# }
# NOT RUN {
if (interactive()) {
# a poisson regression model
model4 <- glm(event ~ mag + station + dist + accel, data = attenu, family = poisson)
DynNom(model4, attenu, covariate = "numeric")
}
# }
Run the code above in your browser using DataLab