Hi folks,
I am trying to calculate the ordinary least square by matrix; the formula is beta_hat=(X'*X)^(-1)*X'*Y
In STATA, I run the code: matrix beta_hat= syminv(X'*X)*X'*Y
In MATA, I run the code: beta_hat= luinv(X'*X)*X'*Y
Interestingly, all the estimates of parameters of Xs are exactly the same while the estimates for the constant are different. Could you guys explain how it happens?
Thank you very much!
Wu
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/