Statalist The Stata Listserver


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

RE: st: create submatrix from estimates


From   "Tonya Marie Cropper" <tonya_cropper@ksgphd.harvard.edu>
To   "StataList" <statalist-digest@hsphsun2.harvard.edu>
Subject   RE: st: create submatrix from estimates
Date   Sat, 14 Oct 2006 15:19:13 -0400

Thank you so much! I see what I was doing wrong. I was trying to define the matrix in one step: matrix A1 = e(b)[1,1..10]

****************************************************************************************
From Kit Baum <baum@bc.edu>
To statalist@hsphsun2.harvard.edu
Subject st: create submatrix from estimates
Date Sat, 14 Oct 2006 14:01:58 -0400

--------------------------------------------------------------------------------
. webuse grunfeld

. xi: qui regress invest mvalue kstock I.company

. mat beta=e(b)

. mat slope=beta[1,1..2]

. mat rest = beta[1,3..12]

. mat list beta

beta[1,12]
mvalue kstock _Icompany_2 _Icompany_3 _Icompany_4
y1 .1101238 .31006534 172.20251 -165.27514 42.487396

_Icompany_5 _Icompany_6 _Icompany_7 _Icompany_8 _Icompany_9
y1 -44.320126 47.135393 3.7432122 12.751033 -16.925585

_Icompany_10 _cons
y1 63.728842 -70.296685

. mat list slope

slope[1,2]
mvalue kstock
y1 .1101238 .31006534

. mat list rest

rest[1,10]
_Icompany_2 _Icompany_3 _Icompany_4 _Icompany_5 _Icompany_6
y1 172.20251 -165.27514 42.487396 -44.320126 47.135393

_Icompany_7 _Icompany_8 _Icompany_9 _Icompany_10 _cons
y1 3.7432122 12.751033 -16.925585 63.728842 -70.296685


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* 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   |   What's new   |   Site index