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

RE: st: changing beta coefficients

From   "Richard. Williams" <>
Subject   RE: st: changing beta coefficients
Date   Mon, 11 Apr 2005 17:02:35 -0500

At 04:05 PM 4/11/2005, Scott Merryman wrote:

This has to be wrapped up in a program, right?
Whoops, you are right; only an eclass program can do an ereturn repost. I thought -eret2- might let you do it interactively but it gives me a syntax error when I try to change e(b). Assuming this is something you want to do more than once though, perhaps this would be the way to go: (a) write a program whose sole purpose in life is to issue the ereturn repost command (b) make your changes interactively and then call the program with the name of your altered matrix. Example:

program foo, eclass
ereturn repost `1'

. sysuse auto
(1978 Automobile Data)

. qui reg price mpg weight
. matrix list e(b)

mpg weight _cons
y1 -49.512221 1.7465592 1946.0687

. matrix bmat = e(b)

. matrix bmat[1,1]=122

. foo bmat

. matrix list e(b)

mpg weight _cons
y1 122 1.7465592 1946.0687

* For searches and help try:

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