Learn OLS by using SAS IML (Interactive Matrix Language)
Excel is fine, but there is a limitation. We want to experience matrices too. I think doing
so will help us recognize how parts are related in the whole of a statsitical model, like OLS. ALso there is a virtue
of learning PROC IML, which is extremely useful for doing social network analysis, for the calculation of network constructs,
such as density and centrality.
The coefficients for an OLS equation are obtained by only one line, "beta=(inv(t(x)*x))*(t(x)*y);"
And I think there are about five or more lines to get standard errors for the coefficients. This section for standard
errors ends with covariance_of_betas=inv(t(x)*x)#mean_squared_error;" You can know what "covariance-variance
matrix" feels like and looks like.
Before this exercise I had no clue why my professor called it "variance-covariance matrix."
Well, standard errors and covariance of those errors come in a matrix in this way, which is why it is called that way.
Finally, the bonus of trying this is that you will learn how each section is related to each other.
Before this exercise I did not have a strong sense of "sections" in the series of equations that a professor wrote on the
blackboard.
For example, you know the line for coefficient estimates MUST come first before anything else. Things
about Variance should come before the estimation of standard errors, for example. You begin to see the connection among
statistical concepts, such as standard error, t-score, p-value, R-square, etc.