3 Validation du modèle

ozone <- read.table("../donnees/ozone_long.txt", header = T, sep = ";")
mod.lin6v <- lm(O3~T6 + T12 + Ne12 + Ne15 + Vx + O3v,data=ozone)
plot(rstudent(mod.lin6v), pch = ".",ylab = "Résidus studentisés par VC")
abline(h = c(-2,2))
lines(lowess(rstudent(mod.lin6v)))

plot(mod.lin6v, which = 2, sub = "", main = "")
abline(0,1)

plot(cooks.distance(mod.lin6v),type="h",ylab="Distance de Cook")
p <- ncol(ozone) ; n <- nrow(ozone)
seuil1 <- qf(0.1,p,n-p) ; abline(h=seuil1)

infl.ozone <- influence.measures(mod.lin6v)
plot(infl.ozone$infmat[,"hat"],type="h",ylab="hii")
seuil1 <- 3*p/n ; abline(h=seuil1,col=1,lty=2)
seuil2 <- 2*p/n ; abline(h=seuil2,col=1,lty=3)

residpartiels <- resid(mod.lin6v, type = "partial")
prov <- loess(residpartiels[,"O3v"] ~ ozone$O3v)
ordre <- order(ozone$O3v)
plot(ozone$O3v, residpartiels[,"O3v"], pch=".",ylab="",xlab="")
matlines(ozone$O3v[ordre], predict(prov)[ordre])
abline(lsfit(ozone$O3v, residpartiels[,"O3v"]), lty = 2)