library(linearModel)
y<-c(30,40,60,70,100);y
## [1] 30 40 60 70 100
x=c(2,3,5,6,8);x
## [1] 2 3 5 6 8
z<-c(6,7,8,10,15);z
## [1] 6 7 8 10 15
#creating data frame
data.frame(x,y,z)
## x y z
## 1 2 30 6
## 2 3 40 7
## 3 5 60 8
## 4 6 70 10
## 5 8 100 15
#correlation
cor(x,y)
## [1] 0.9941348
cor(x,z)
## [1] 0.9461426
cor(y,z)
## [1] 0.9733995
#regression
t=lm(y~x+z)
aov(t)
## Call:
## aov(formula = t)
##
## Terms:
## x z Residuals
## Sum of Squares 2964.9123 30.8044 4.2834
## Deg. of Freedom 1 1 2
##
## Residual standard error: 1.463448
## Estimated effects may be unbalanced
plot(t)




y<-c(30,40,60,70,100);y
## [1] 30 40 60 70 100
x=c(2,3,5,6,8);x
## [1] 2 3 5 6 8
z<-c(6,7,8,10,15);z
## [1] 6 7 8 10 15
#creating data frame
data.frame(x,y,z)
## x y z
## 1 2 30 6
## 2 3 40 7
## 3 5 60 8
## 4 6 70 10
## 5 8 100 15
#correlation
cor(x,y)
## [1] 0.9941348
cor(x,z)
## [1] 0.9461426
cor(y,z)
## [1] 0.9733995
#regression
t=lm(y~x+z)
aov(t)
## Call:
## aov(formula = t)
##
## Terms:
## x z Residuals
## Sum of Squares 2964.9123 30.8044 4.2834
## Deg. of Freedom 1 1 2
##
## Residual standard error: 1.463448
## Estimated effects may be unbalanced
plot(t)



