Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Y = mtcars[1]
- X = mtcars[2:6]
- Y <- array(data = c(unlist(Y)),dim = c(6,1))
- X <- array(data = c(unlist(X)),dim = c(6,5))
- EGY = array(data=1,dim=c(6,1))
- X = cbind(EGY,X)
- b = (solve(t(X) %*% X))%*%t(X) %*%Y
- #mpg ? ezek melett: cyl disp hp drat wt
- eredmeny = (b[1]+ X[1,2]*b[2]+ X[1,3]*b[3]+ X[1,4]*b[4]+ X[1,5]*b[5]+ X[1,6]*b[6])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement