Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Multiple Regression and Binomial Regression Sample
#Linear and multiple Regression data(iris) str(iris) head(iris) attach(iris) Fit=lm(Petal.Length~Sepal.Length) summary(Fit) plot(Petal.Length~Sepal.Length) Fit2=lm(Petal.Length~. , data=iris) summary(Fit2) Fit3=lm(Petal.Length~. -Species, data=iris) summary(Fit3) #Logistic Regression data(mtcars) str(mtcars) library(ggplot2) attach(mtcars) ggplot(mtcars, aes(wt, am))+geom_point()+stat_smooth(method="glm", method.args=list(family="binomial"), se=FALSE)+ggtitle ("Sigmoid Curve Sample") Binom=glm(am~wt, family=binomial(link='logit')) summary(Binom) #Probability of Y happening if X is hp=120, wt=2.8 newdata=data.frame(hp=120, wt=2.8) predict(Binom, newdata, type="response") #Multiple Regression library(MASS) library(car) library(lmtest) str(mtcars) names(mtcars) attach(mtcars) head(mtcars) Mod=lm(mpg~wt+hp+qsec+cyl) plot(Mod) #Normality of Residuals shapiro.test(Mod$residuals) #Homoesdacity of residuals ncvTest(Mod) #Autocorrelation dwtest(Mod) pairs(mtcars)
run
|
edit
|
history
|
help
1
Please
log in
to post a comment.
Practices - 1
Paired t-test [ Zinc Concentration]
First blood
21-09-2020Intpoli
R Distribution Results
Regressão linear
21-09-2020IntpoliLagaproxf
Comparison of two normal distributions, example Treatment with HCQ
26-08-2020Teste
asdf
Please log in to post a comment.