Lab3Kaibo GongThursday, February 4, 2015Homework formatYou need to use rmarkdown to format your homework. The format allowed .pdf, .doc(.docx),and .html. Make sure your submission is organized and readable for grader. Directly submitthe code (.Rmd or .R file) will receive 0.Simple Linear RegressionAssumptionsE(Y|X=x) =β0+β1xV ar(Y|X=x) =σ2HereE(Y|X=x) =β0+β1xis the true mean function.OLS EstimationBy OLS (Ordinary Least Square), we can obtain the estimated mean function:ˆE(Y|X=x) =ˆβ0+ˆβ1xwhereˆβ0andˆβ1are the estimators ofβ0andβ1.Estimation ofσ2The estimate ofσ2isˆσ2=RSSn-2We haven-2as our denominator because we used 2 degrees of freedom in estimatingβ0andβ1.Standard Error and t-TestRefer Section 2.5 and 2.6.1
SE for fitted value and SE for predictionThe difference between these two standard errors is: For prediction, we need to take therandom error term into consideration (page.32), which means the SE for prediction shouldalways be larger than the SE for fitted value given the same x-value.