Answer:
a) > x<-c(1,2,3,4,5)
> y<-c(1.9,3.5,3.7,5.1,6)
> linearmodel<-lm(y~x)
And the output is given by:
> linearmodel
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
1.10 0.98
b)
And if we compare this with the general model
We see that the slope is m= 0.98 and the intercept b = 1.10
Explanation:
Part a
For this case we have the following data:
x: 1,2,3,4,5
y: 1.9,3.5,3.7,5.1, 6
For this case we can use the following R code:
> x<-c(1,2,3,4,5)
> y<-c(1.9,3.5,3.7,5.1,6)
> linearmodel<-lm(y~x)
And the output is given by:
> linearmodel
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
1.10 0.98
Part b
For this case we have the following trend equation given:
And if we compare this with the general model
We see that the slope is m= 0.98 and the intercept b = 1.10