challenger <- read.table("http://verso.mat.
table(challenger$defecto)
colores <- NULL
colores[challenger$defecto == 0] <- "green"
colores[challenger$defecto == 1] <- "red"
plot(challenger$temp, challenger$defecto, pch = 21, bg = colores, xlab = "Temperatura(F)", ylab = "Probabilidad de defectos")
#Una temperatura de 80 grados para arriba hubiera sido seguro realizar el lanzamiento
legend("bottomleft", c("No defecto", "Si defecto"), pch = 21, col = c("green", "red")) #legend sirve para poner leyendas en la grafica
temperature.chall <- lm(defecto ~ temp, data=challenger)
anova(temperature.chall)
summary(temperature.chall)
curve(predict(temperature.
add=TRUE, col="red")
library(sjPlot)
p <- plot_model(temperature.chall, type = "pred", terms ="temp[n=300]",
digits=1, line.size=0.5, show.data=T) # Color blind friendly.
p
temperature.chall1 <- glm(defecto ~ temp, data=challenger,binomial)
summary(temperature.chall1)
anova(temperature.chall1, test="Chisq")
summary(temperature.chall1)
curve(predict(temperature.
add=TRUE, col="blue")