[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Refer to parameter vector using variable-name abbreviation

From   Falko Juessen <>
Subject   st: Refer to parameter vector using variable-name abbreviation
Date   Fri, 2 Nov 2007 10:56:27 +0100 (CET)

Dear all,
I want to refer to elements of the estimated parameter vector after the
–regress- command, using variable-name abbreviation.

This is an example:

generate weight2 = weight^2
generate weight3 = weight^3
reg mpg price weight*

[output omitted]

I want to get the coefficients for all parameters on "weight", but not the
coefficients for "price" and the constant. This works fine:

mat save = e(b)
mat mybetas = save[1,"weight".."weight3"]
mat list mybetas

        weight     weight2     weight3
y1  -.03065277   6.441e-06  -4.884e-10

I wonder whether the same result can be obtained using variable-name
abbreviation, which for some reasons would be much more convenient in my
analysis (because my actual variables have been coded using the –xi-
command). That is, I want something like

mat mybetas = save[1,"weight*"]
mat list mybetas

*weight* not found

which unfortunately does not seem to work. Is there a solution to this?



*   For searches and help try:

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