Answer:
a) ![y=-0.317 x +46.02](https://tex.z-dn.net/?f=y%3D-0.317%20x%20%2B46.02)
b) Figure attached
c) ![S^2=\hat \sigma^2=MSE=\frac{190.33}{10}=19.03](https://tex.z-dn.net/?f=S%5E2%3D%5Chat%20%5Csigma%5E2%3DMSE%3D%5Cfrac%7B190.33%7D%7B10%7D%3D19.03)
Step-by-step explanation:
We assume that th data is this one:
x: 30, 30, 30, 50, 50, 50, 70,70, 70,90,90,90
y: 38, 43, 29, 32, 26, 33, 19, 27, 23, 14, 19, 21.
a) Find the least-squares line appropriate for this data.
For this case we need to calculate the slope with the following formula:
![m=\frac{S_{xy}}{S_{xx}}](https://tex.z-dn.net/?f=m%3D%5Cfrac%7BS_%7Bxy%7D%7D%7BS_%7Bxx%7D%7D)
Where:
![S_{xy}=\sum_{i=1}^n x_i y_i -\frac{(\sum_{i=1}^n x_i)(\sum_{i=1}^n y_i)}{n}](https://tex.z-dn.net/?f=S_%7Bxy%7D%3D%5Csum_%7Bi%3D1%7D%5En%20x_i%20y_i%20-%5Cfrac%7B%28%5Csum_%7Bi%3D1%7D%5En%20x_i%29%28%5Csum_%7Bi%3D1%7D%5En%20y_i%29%7D%7Bn%7D)
![S_{xx}=\sum_{i=1}^n x^2_i -\frac{(\sum_{i=1}^n x_i)^2}{n}](https://tex.z-dn.net/?f=S_%7Bxx%7D%3D%5Csum_%7Bi%3D1%7D%5En%20x%5E2_i%20-%5Cfrac%7B%28%5Csum_%7Bi%3D1%7D%5En%20x_i%29%5E2%7D%7Bn%7D)
So we can find the sums like this:
![\sum_{i=1}^n x_i = 30+30+30+50+50+50+70+70+70+90+90+90=720](https://tex.z-dn.net/?f=%5Csum_%7Bi%3D1%7D%5En%20x_i%20%3D%2030%2B30%2B30%2B50%2B50%2B50%2B70%2B70%2B70%2B90%2B90%2B90%3D720)
![\sum_{i=1}^n y_i =38+43+29+32+26+33+19+27+23+14+19+21=324](https://tex.z-dn.net/?f=%5Csum_%7Bi%3D1%7D%5En%20y_i%20%3D38%2B43%2B29%2B32%2B26%2B33%2B19%2B27%2B23%2B14%2B19%2B21%3D324)
![\sum_{i=1}^n x^2_i =30^2+30^2+30^2+50^2+50^2+50^2+70^2+70^2+70^2+90^2+90^2+90^2=49200](https://tex.z-dn.net/?f=%5Csum_%7Bi%3D1%7D%5En%20x%5E2_i%20%3D30%5E2%2B30%5E2%2B30%5E2%2B50%5E2%2B50%5E2%2B50%5E2%2B70%5E2%2B70%5E2%2B70%5E2%2B90%5E2%2B90%5E2%2B90%5E2%3D49200)
![\sum_{i=1}^n y^2_i =38^2+43^2+29^2+32^2+26^2+33^2+19^2+27^2+23^2+14^2+19^2+21^2=9540](https://tex.z-dn.net/?f=%5Csum_%7Bi%3D1%7D%5En%20y%5E2_i%20%3D38%5E2%2B43%5E2%2B29%5E2%2B32%5E2%2B26%5E2%2B33%5E2%2B19%5E2%2B27%5E2%2B23%5E2%2B14%5E2%2B19%5E2%2B21%5E2%3D9540)
![\sum_{i=1}^n x_i y_i =30*38+30*43+30*29+50*32+50*26+50*33+70*19+70*27+70*23+90*14+90*19+90*21=17540](https://tex.z-dn.net/?f=%5Csum_%7Bi%3D1%7D%5En%20x_i%20y_i%20%3D30%2A38%2B30%2A43%2B30%2A29%2B50%2A32%2B50%2A26%2B50%2A33%2B70%2A19%2B70%2A27%2B70%2A23%2B90%2A14%2B90%2A19%2B90%2A21%3D17540)
With these we can find the sums:
![S_{xx}=\sum_{i=1}^n x^2_i -\frac{(\sum_{i=1}^n x_i)^2}{n}=49200-\frac{720^2}{12}=6000](https://tex.z-dn.net/?f=S_%7Bxx%7D%3D%5Csum_%7Bi%3D1%7D%5En%20x%5E2_i%20-%5Cfrac%7B%28%5Csum_%7Bi%3D1%7D%5En%20x_i%29%5E2%7D%7Bn%7D%3D49200-%5Cfrac%7B720%5E2%7D%7B12%7D%3D6000)
![S_{xy}=\sum_{i=1}^n x_i y_i -\frac{(\sum_{i=1}^n x_i)(\sum_{i=1}^n y_i)}=17540-\frac{720*324}{12}{12}=-1900](https://tex.z-dn.net/?f=S_%7Bxy%7D%3D%5Csum_%7Bi%3D1%7D%5En%20x_i%20y_i%20-%5Cfrac%7B%28%5Csum_%7Bi%3D1%7D%5En%20x_i%29%28%5Csum_%7Bi%3D1%7D%5En%20y_i%29%7D%3D17540-%5Cfrac%7B720%2A324%7D%7B12%7D%7B12%7D%3D-1900)
And the slope would be:
![m=-\frac{1900}{6000}=-0.317](https://tex.z-dn.net/?f=m%3D-%5Cfrac%7B1900%7D%7B6000%7D%3D-0.317)
Nowe we can find the means for x and y like this:
![\bar x= \frac{\sum x_i}{n}=\frac{720}{12}=60](https://tex.z-dn.net/?f=%5Cbar%20x%3D%20%5Cfrac%7B%5Csum%20x_i%7D%7Bn%7D%3D%5Cfrac%7B720%7D%7B12%7D%3D60)
![\bar y= \frac{\sum y_i}{n}=\frac{324}{12}=27](https://tex.z-dn.net/?f=%5Cbar%20y%3D%20%5Cfrac%7B%5Csum%20y_i%7D%7Bn%7D%3D%5Cfrac%7B324%7D%7B12%7D%3D27)
And we can find the intercept using this:
![b=\bar y -m \bar x=27-(-0.317*60)=46.02](https://tex.z-dn.net/?f=b%3D%5Cbar%20y%20-m%20%5Cbar%20x%3D27-%28-0.317%2A60%29%3D46.02)
So the line would be given by:
![y=-0.317 x +46.02](https://tex.z-dn.net/?f=y%3D-0.317%20x%20%2B46.02)
b) Plot the points and graph the line as a check on your calculations.
For this case we can use excel and we got the figure attached as the result.
c) Calculate S^2
In oder to calculate S^2 we need to calculate the MSE, or the mean square error. And is given by this formula:
![MSE=\frac{SSE}{df_{E}}](https://tex.z-dn.net/?f=MSE%3D%5Cfrac%7BSSE%7D%7Bdf_%7BE%7D%7D)
The degred of freedom for the error are given by:
![df_{E}=n-2=12-2=10](https://tex.z-dn.net/?f=df_%7BE%7D%3Dn-2%3D12-2%3D10)
We can calculate:
![S_{y}=\sum_{i=1}^n y^2_i -\frac{(\sum_{i=1}^n y_i)^2}{n}=9540-\frac{324^2}{12}=792](https://tex.z-dn.net/?f=S_%7By%7D%3D%5Csum_%7Bi%3D1%7D%5En%20y%5E2_i%20-%5Cfrac%7B%28%5Csum_%7Bi%3D1%7D%5En%20y_i%29%5E2%7D%7Bn%7D%3D9540-%5Cfrac%7B324%5E2%7D%7B12%7D%3D792)
And now we can calculate the sum of squares for the regression given by:
![SSR=\frac{S^2_{xy}}{S_{xx}}=\frac{(-1900)^2}{6000}=601.67](https://tex.z-dn.net/?f=SSR%3D%5Cfrac%7BS%5E2_%7Bxy%7D%7D%7BS_%7Bxx%7D%7D%3D%5Cfrac%7B%28-1900%29%5E2%7D%7B6000%7D%3D601.67)
We have that SST= SSR+SSE, and then SSE=SST-SSR= 792-601.67=190.33[/tex]
So then :
![S^2=\hat \sigma^2=MSE=\frac{190.33}{10}=19.03](https://tex.z-dn.net/?f=S%5E2%3D%5Chat%20%5Csigma%5E2%3DMSE%3D%5Cfrac%7B190.33%7D%7B10%7D%3D19.03)