Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: estimation results


From   Christopher F Baum <[email protected]>
To   [email protected]
Subject   st: Re: estimation results
Date   Fri, 20 Aug 2004 07:41:02 -0400

On Aug 20, 2004, at 2:33 AM, Oleksandr wrote:

I use matrix commands to estimate the coefficients of a regression. I
have got coefficient and variance/covarience matricies: beta and VC. How
to get from VC to std. errors?

I suppose first line is
ER=vecdiag(VC)
The second step is to take a square root of each element of ER. How can
I do it in one line without going into loops and cyles?

More generally, how can I present the results in the form similar to the
Stata: means, std. errors, t-statistics and conf. intervals?
If you write an e-class command, as described in the programming manual, Stata will do all of this work for you. Here is a code fragment that illustrates this. Prior to this point, I have used matrix commands to tweak the b and V matrices to reflect a different specification:

* post the revised coefficient vector and v-c matrix, with
* the standard error of the transformed error term as an additional entry
ereturn post `beta' `VV' , depname(`depn') obs(`enn') esample(`touse')

* display the results and return in ereturn
di _n "Scaled probit estimates (scale : {result:`scale'}) {col 51}Number of obs = {col 70}{result:{ralign 9:`enn'}}"
ereturn display

The 'ereturn display' will present the standard Stata estimation output table, with standard errors, t or z values, p values, confidence intervals, etc.

Just follow the rules in [p] on rolling your own estimation command.

Kit

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index