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

st: Re: altering e(b)


From   baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
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 <owner-statalist@hsphsun2.harvard.edu> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index