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

st: RE: change values of e(b)

From   "Nick Cox" <>
To   <>
Subject   st: RE: change values of e(b)
Date   Wed, 4 Dec 2002 08:50:04 -0000

Hung-Jen Wang
> Is there any way to change elements of the coefficient vector e(b)
> obtained after an estimation? For example, suppose I want to
> replace the 5th element of the coefficient vector by a value of
> 2.2; the following does not work:
>  . mat e(b)[1,5] = 2.2
>  matrix operation not found
>  r(501);
> I know the following works:
>  . mat b0 = e(b)
>  . mat b0[1,5] = 2.2
> but I want to work with e(b) since I'll later use -predict- to do
> some experiments, and I assume that -predict- recognizes e(b)
> only.

e(b) is part of what is left behind after 
a certain model is estimated on a 
certain data set. 

Change the data fed to the model, 
or change the model, and estimate by reissuing 
the model command, and e(b) will (almost always) 

So if you want to use -predict- 
after a different fit, you need 
to estimate again. 

Revising history is best left
to science fiction writers and, indeed, 

*   For searches and help try:

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