Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: how to use command to obtain the coefficient in a regression?


From   "Joseph Coveney" <[email protected]>
To   <[email protected]>
Subject   st: Re: how to use command to obtain the coefficient in a regression?
Date   Wed, 25 Apr 2012 10:27:25 +0900

Poro Zhang wrote:

I am using "Program Define" to do Monte Carlo Simulation for regression. I want
to repeat the simulation for 10000 times and test whether the mean of the
coefficient_hat equals the true value. However, I just cannot find the e(class)
for the coefficient to complete the command " return scalar XXX=XXX"

--------------------------------------------------------------------------------

The easiest way is to use the underscore variable. For example, after a 
single-equation regression command, it would be:

	return scalar XXX = _b[XXX]

where XXX is the name of your regression coefficient.

See your Stata user's manual Volume [U]. Section 13.5 (and Section 13.4) for 
more details.

It's also described in the Stata online help for underscore variables.  Type

	help _variables

at the command line.

Joseph Coveney


*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index