Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.0 kB
1
Indexable
Never
###OUTLIERS e ptos influentes####
boxplot(mrl.stepforward2$residuals) #potenciais outliers
plot(mrl.stepforward2) #ver leverage plot
outlierTest(mrl.stepforward2) #teste de bonferroni
influencePlot(mrl.stepforward2) #hat value > 0.5 -> 99,113
cooksD <- cooks.distance(mrl.stepforward2)
plot(cooksD, main = "Cook's Distance") 
abline(h = 4/nrows, col = "red") #9?

influence <- influence.measures(mrl.stepforward2)
obsinfluentes<- which(apply(influence$is.inf, 1, any))
dados_treino_sem <- dados_treino[-c(obsinfluentes),]
y_treino2_sem <- y_treino2[-c(obsinfluentes)]
mrl.stepforward2_sem <- lm(y_treino2_sem ~ Shock.Type + Sex + Diastolic.Pressure + Systolic.Pressure + 
                             Age + Body.Surface.Area + Sex:Body.Surface.Area + Sex:Systolic.Pressure + 
                             Sex:Diastolic.Pressure + Diastolic.Pressure:Body.Surface.Area,data=dados_treino_sem)
summary(mrl.stepforward2_sem)
extractAIC(mrl.stepforward2_sem)
anova(mrl.stepforward2_sem, mrl.int2)
formula(mrl.stepforward2_sem)