[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: how do i save the significance levels of coefficients after estimation?
Ada Ma <email@example.com> asked,
> Coming back with more questions - the estimation I did have lost of
> dropped variables, and when I tried to implement:
> mat se= vecdiag(cholesky(diag(vecdiag(e(V)))))'
> Stata replies saying:
> matrix not positive definite
> How can I trim the zeros from the e(b) and e(V) matrices before I
> perform the commands posted by Maarten?
vecdiag(cholesky(diag(vecdiag(e(V)))))' is hardly an efficient way of
calculating the square roots of the diagonal elements of e(V), but I
understand why, using the old matrix language, Ada wrote it that way.
Putting aside efficiency, I do not think Ada really wants to drop rows
and columns from e(V) because, if she does that, she will no longer know
which standard error goes with which variable.
I suggest that, in Mata,
is what is desired, so rather than coding
. mat se= vecdiag(cholesky(diag(vecdiag(e(V)))))'
I would code
. mata: st_matrix(se, sqrt(diagonal(st_matrix("e(V)"))))
Mata's sqrt() function does an element-by-element squareroot.
* For searches and help try: