# st: using coefficients from model

 From Chris Witte To statalist@hsphsun2.harvard.edu Subject st: using coefficients from model Date Mon, 30 Mar 2009 12:55:40 -0700 (PDT)

```I am using stata 9.2.  I would like to know how to call the coefficients from the estimation results matrix e(b) and use them in an equation.  For example, if my matrix e(b) has values for  "_cons" and coefficient "test", I would like to calculate the answer to an equation y = [_cons] + x*[test].  How can I do this?

The reason why I want to do this is because I am trying to find the value _fracpoly_ adjusts its estimates by.  If I use this output from my _fracpoly_ estimation:

study1twsg       Coef.   Std. Err.      t    P>t     [95% Conf. Interval]
Itemp__1    15093.12   4454.121     3.39   0.012     4560.802    25625.45
Itemp__2   -10666.18    3136.84    -3.40   0.011    -18083.63   -3248.734
Itemp__3    1945.114   569.9302     3.41   0.011     597.4436    3292.785
_cons    .0053322   .0008244     6.47   0.000     .0033828    .0072815
Deviance:  -113.24. Best powers of temp among 164 models fit: -2 -2 -2.

and I plug in these coefficients with my 'x' having a value of 25, my linear regression equation for predicting y is:

y=.0053322+(15093.12*25^-2)+(-10666.18*25^-2*log(25))+1945.114*25^-2*(log(25))^2

However, this equation does not yield the same value as _predict_ (or _fracpred_), and this is because fracpoly secretly adjusts its constant.  If I can calculate the answer to this equation and put it into a variable, I can then find the difference between this variable and the value that _fracpred_ gives.

Thank you for your help.  Hopefully this isn't too confusing.

Chris

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```