Consider the simple linear regression model $y=50 + 10x + \varepsilon$ where $\varepsilon$ is $NID (0,16)$. Suppose that $n=20$ pairs of observations are used to fit this model. Generate $500$ samples of $20$ observations, drawing one observation for each level of $x=1,1.5,2,...,10$ for each sample.
a. For each sample compute the least-squares estimates of the slope and intercept. Construct histograms of the sample values of $\widehat{\beta _{0}}$ and $\widehat{\beta _{1}}$ . Discuss the shapes of these histograms.
b. For each sample, compute an estimate of $E(y|x=5)$. Construct a histogram of the estimates you obtained and discuss the shape of the histograms.
c. For each sample, compute a $95\%$ CI on the slope. How many of these intervals contain the true value $\beta _{1}=10$? Is this what we would expect?
d. For each estimate of $E(y|x=5)$ in part b, compute the $95\%$ CI. How many of these intervals contain the true value of $E(y|x=5)=100$? Is this what we would expect?
Please help me how can I do? I'm stuck in first question.