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

st: Re: altering e(b)


From   baum <[email protected]>
To   [email protected]
Subject   st: Re: altering e(b)
Date   Thu, 05 Dec 2002 08:21:50 -0500


--On Thursday, December 5, 2002 2:33 -0500 statalist-digest <[email protected]> wrote:


So, from a pure technical point of view, is it possible to change
values of e(b)?

I believe not. You can read from it but not
write to it directly.
That is certainly untrue; estimates post does that for a living. That is, write a program that is a wrapper for your estimation command, grab the e(b) and e(V) into matrices within the routine, and use estimates post to make them the active e(b) and e(V).

program define tweak
syntax ,coef(int) val(real)
mat b = e(b)
mat V = e(V)
mat b[1,`coef'] = `val'
estimates post b V
end

This program will change the specified element of the coefficient vector to the specified value. After it is run, e(b) will contain the altered coefficient vector. A well-written variant would check the appropriateness of coef before attempting to modify the b matrix.

Kit

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