Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

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

From |
"Joseph Coveney" <jcoveney@bigplanet.com> |

To |
<statalist@hsphsun2.harvard.edu> |

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/

**References**:**st: how to use command to obtain the coefficient in a regression?***From:*"Poro Zhang" <conantiancai_stata@163.com>

- Prev by Date:
**Re: st: diagnostic plots with svy:reg** - Next by Date:
**st: cholesky vs matpowersym for FGLS transformation in Mata** - Previous by thread:
**st: how to use command to obtain the coefficient in a regression?** - Next by thread:
**st: cholesky vs matpowersym for FGLS transformation in Mata** - Index(es):