Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: Accessing to a subvector of vector like
From
Nick Cox <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
st: RE: Accessing to a subvector of vector like
Date
Mon, 6 Feb 2012 16:19:51 +0000
Just copy to a regular vector first:
sysuse auto
gen gpm = 1 / mpg
regress gpm weight length displacement
. mat li e(b)
e(b)[1,4]
weight length displacement _cons
y1 .00001174 .00006458 5.517e-06 .00152916
. mat b = e(b)
. mat b1 = b[1, "weight".. "length"]
. mat li b1
b1[1,2]
weight length
y1 .00001174 .00006458
Nick
[email protected]
Nakelse, Tebila (AfricaRice)
I would like to access to a subvector of a vector like e(b) or e(V).
Stata allows to have et sub-element as _b[varname]. Is it possible to have _b[varlist] ?
*
* 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/