Dear Statalist users,
I would need to write a programme that gives me the b coefficients of an OLS regression, using weights.
This is an easy task if no weights are used with b being (X'X)-1(X'Y):
mat accum xprimex = x
mat vecaccum yprimex = y x
*Transpose
mat xprimey =yprimex'
mat b = inv(xprimex)*(xprimey)
mat list b
However, I would like to estimate b=(X'DX)-1 X'DY, hence applying design weights.
D is now a diagonal weight matrix.
My sample size is considerably above 800 which creates problems with matsize. And I find the command matrix glsaccum rather difficult to apply.
Could anyone help?
Many thanks
Sylke V. Schnepf
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/