top of page
Writer's pictureCatsandcodes /blogsite

1

lr

data<-read.csv("titanic.csv")

summary(data)

str(data)

any(is.na(data))

library(ggplot2)

ggplot(data,aes(Survived))+geom_bar(aes(fill=factor(Survived)),alpha=0.5)

model<-glm(formula=Survived~.,family = binomial(link='logit'),data=data)

summary(model)

prob<-predict(model,type='response')

prob

library(gmodels)

CrossTable(data$Survived,fitted(model)>0.5)

library(ROCR)

auc<-performance(pred,"auc")

auc@y.values

var sel

data("mtcars")

library(olsrr)

model <- lm(mpg ~ disp + hp + wt + qsec, data = mtcars)

ols_step_all_possible(model)

ols_step_best_subset(model)

summary(model)


ols_step_forward_p(model)

ols_step_backward_p(model)

ols_step_both_p(model)


step(lm(mpg~., data=mtcars), direction="backward")

step(lm(mpg~1, data=mtcars), direction="forward")

step(lm(mpg~., data=mtcars), direction="both")

mlr - homoscadasicity

multicolinearity

mlr assumptions

anova : hypo testing






10 views
bottom of page