You have probably learned in one of your introductory statisics classes the matrix form of least squares regression. You have probably learned that \(\mathbf{\hat{\beta}} = \mathbf{{(X^TX)^{-1}}X^Ty}\). We have not yet learned about the way that R does regressions. We will write our own function to estimate the betas in least squares regression. This function will be called LinearRegression()
.
solve()
.LinearRegression()
is working properly. Without having another function as a benchmark, how are you going to ensure that LinearRegression()
is working properly?LinearRegression()
and test it. Write up the results of your tests. What is your evidence for your function working. Having now designed the function is there something you would do differently the next time?analyze_all()
function from Software Capentry Lesson 3.Extra Credit
Return the standard errors with your LinearRegression()
Function.