<- read.table("../donnees/ozone.txt", header = T, sep = ";")
ozone library(leaps)
<- regsubsets(O3 ~ T12 + T15 + Ne12 + N12 + S12 + E12 + W12 + Vx + O3v, int = T,nbest = 1, nvmax = 10, method = "exhaustive", data = ozone) recherche
7 Choix de variables
plot(recherche, scale = "bic")
plot(recherche, scale = "Cp")
plot(recherche, scale = "adjr2")
plot(recherche, scale = "r2")
<- summary(recherche)
resume <- colnames(resume$which)[resume$which[which.min(resume$bic),]][-1]
nomselec <- formula(paste("O3~",paste(nomselec,collapse="+")))
formule <- lm(formule, data = ozone)
modeleslectionne modeleslectionne
Call:
lm(formula = formule, data = ozone)
Coefficients:
(Intercept) T15 Ne12 Vx O3v
61.8252 1.0577 -3.9935 0.3146 0.2629