You are on page 1of 1

Lecture- Simple and Multiple Regression

cor(mtcars$mpg, mtcars$disp)

plot(mtcars$mpg,mtcars$disp)

Regression1=lm(mtcars$mpg~mtcars$disp)# mpg as DV and DISP used IV

Regression1

Y=a+bX

mpg= 29.59-0.041 (DISP)

Regression2= lm(mtcars$disp~mtcars$mpg) # DISP as DV and mpg as IV

Regression2

disp= 580.88-17.43 (MPG)

cor(women$height,women$weight)

plot(women$height,women$weight)

Regression3=lm(women$weight~women$height)

Regression3

y=a+bx

weight=-87.52+3.45(height)

summary(Regression3)

Regression4=lm(mpg~disp + hp + drat + wt + qsec,data=mtcars)# mpg id DV and other are IVs (Multiple


Regression)

Regression4

Y=a+b1x1+b2x2+b3x3+b4x4.....bnXn

mpg=16.53357+0.00872*disp-0.02060*hp+2.01577*drat-4.38546*wt+0.64015*qsec

summary(Regression4)

You might also like