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

RE: st: changing beta coefficients


From   "Richard. Williams" <[email protected]>
To   [email protected]
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:
Richard,

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'
end

. sysuse auto
(1978 Automobile Data)

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

e(b)[1,3]
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)

e(b)[1,3]
mpg weight _cons
y1 122 1.7465592 1946.0687

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