vektor

cara membuat Data dalam bentuk vektor.

#create sample data
X <- c(15, 17, 19, 20, 22, 50, 25, 50)
Y <- c(150, 200, 235, 226, 267, 300, 310, 400)
#print sample
X
## [1] 15 17 19 20 22 50 25 50
Y
## [1] 150 200 235 226 267 300 310 400

simple Linear Regression

Y = a + bx

Y = 170 + 17x

scatter plot

plot(Y -X, ylab="Y" , pch=20 )

#systematic Relationship to the plot

abline(a =310, b=-40)