Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: RE: Accessing to a subvector of vector like


From   "Nakelse, Tebila (AfricaRice)" <T.Nakelse@cgiar.org>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: RE: Accessing to a subvector of vector like
Date   Mon, 6 Feb 2012 17:51:20 +0000

Thank you Nick 
I tried this solution.  But it still not working. 
I want to use expression(pnl_exp) in margins. But if I use this solution stata may not know whether this coefficients are from a estimation and may not  use this information to compute the matrix of covariance for example.

Best regards
Tebila



-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nakelse, Tebila (AfricaRice)
Sent: Monday, February 06, 2012 6:12 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: RE: Accessing to a subvector of vector like

Thank you Nick. It is okay.
Tebila
-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: Monday, February 06, 2012 5:20 PM
To: 'statalist@hsphsun2.harvard.edu'
Subject: st: RE: Accessing to a subvector of vector like

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 
n.j.cox@durham.ac.uk 

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/

*
*   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/

*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index