Created
September 10, 2021 17:13
-
-
Save eliardocosta/d73b2b82a0ac19d38af3c6d29b2c99b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(aplore3) | |
data(chdage) | |
head(chdage) | |
# ajuste 1 | |
mod1 <- glm(chd ~ age, family = binomial(), data = chdage) | |
summary(mod1) | |
# | |
exp(-5.309 + 0.111*50)/(1 + exp(-5.309 + 0.111*50)) | |
# | |
pix <- function(x) { | |
exp(-5.309 + 0.111*x)/(1 + exp(-5.309 + 0.111*x)) | |
} | |
plot(function(x) pix(x), 0, 80, ylim = c(0, 1), | |
ylab = expression(paste(pi, "(AGE)")), xlab = "AGE") | |
abline(h = 1, lty = 2) | |
# com variavel categorica | |
mod2 <- glm(chd ~ agegrp, family = binomial(), | |
data = chdage) | |
summary(mod2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment