Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# Re: st: Editing values in postestimation coefficient matrix

 From ETHAN SHARYGIN To statalist@hsphsun2.harvard.edu Subject Re: st: Editing values in postestimation coefficient matrix Date Wed, 5 Sep 2012 13:37:23 -0400

```Excellent, thanks for the reference. This is a very useful command,
and solves the problem neatly.

Ethan

On Wed, Sep 5, 2012 at 1:10 PM, Scott Merryman <scott.merryman@gmail.com> wrote:
> See -help ereturn post-
>
> Example:
> sysuse auto
> qui reg mpg price weight gear
> mat list e(b)
> mat a = e(b)
> qui reg mpg price weight head
> mat list e(b)
> mat b = e(b)
> mat b[1,1] = a[1,1]
> ereturn post b
> mat list e(b)
>
> Scott
>
>
> On Wed, Sep 5, 2012 at 11:53 AM, ETHAN SHARYGIN <garba@sas.upenn.edu> wrote:
>> Dear Statalisters,
>>
>> Has anyone discovered a way to alter the values in the coefficient
>> matrix after a regression? I realize they can be converted to a
>> regular matrix and manipulated-- but I need to use commands to work
>> with the postestimation matrix e(b) so having them stored as a regular
>> Stata matrix would not work.
>>
>> It seems that e(b) and other values in return/ereturn are stored
>> somewhere special where mere mortal users can't toy with them. I'm
>> hoping there are some superusers here who might know if it can be
>> done, and how.
>>
>> (In short, I need to run two similar regressions and then calculate
>> predictions using coefficients for a few of the variables from the
>> first regression and coefficients for the the remainder of the
>> variables from the second-- alternative approaches to achieve this end
>> are welcome).
>>
>> Thanks, and regards,
>> Ethan
> *
> *   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/
*
*   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/
```