Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
523 B
5
Indexable
Never
summary(dados_treino)
mrl.full <- lm(y_treino~.,data=dados_treino)

#stepforward
mrl.base <-lm(y_treino~1,
            data=dados_treino)

mrl.stepforward<-step(mrl.base,
                    scope = list(upper = formula(mrl.full), lower = formula(mrl.base)),
                    direction = "forward", trace="FALSE")

summary(mrl.stepforward)
#Shock.Type + Sex + Age

#stepbackward
mrl.stepbackward <- step(mrl.full, direction = "backward", trace=FALSE)

summary(mrl.stepbackward)
#Age + Sex + Shock.Type