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]

Re: st: Extracting specific elements from a matrix


From   Eric Booth <ebooth@ppri.tamu.edu>
To   "<statalist@hsphsun2.harvard.edu>" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Extracting specific elements from a matrix
Date   Mon, 5 Jul 2010 23:17:04 +0000

<>


Ah, very useful.  Thanks, Martin.

~ Eric

__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
ebooth@ppri.tamu.edu
Office: +979.845.6754

On Jul 5, 2010, at 4:50 PM, Martin Weiss wrote:

> 
> <>
> 
> 
> If "all at once" is desired, Roger`s -ssc d parmest- is more convenient:
> 
> 
> ***********
> sysuse auto, clear
> ds price make, not
> regress price `r(varlist)' , nocons
> 
> capture which parmest
> if _rc ssc install parmest
> 
> parmest, saving(betas, replace)
> u betas, clear
> l parm estimate
> ***********
> 
> 
> HTH
> Martin
> 
> 
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Eric Booth
> Sent: Montag, 5. Juli 2010 23:42
> To: <statalist@hsphsun2.harvard.edu>
> Subject: Re: st: Extracting specific elements from a matrix
> 
> <>
> 
> 
> Or you can use -svmat- to get them all at once.  e.g., 
> 
> ******************************!
> clear
> webuse auto
> ds price make, not
> regress price `r(varlist)' , nocons
> mat A = get(_b)
> matrix li A
> *****
> preserve
> clear
> svmat A, names(beta_)
> g id = _n
> reshape long beta_, i(id) j(beta_num)
> drop id
> save betas.dta, replace
> restore
> *****
> use betas.dta, clear
> ******************************!
> 
> ~ Eric
> __
> Eric A. Booth
> Public Policy Research Institute
> Texas A&M University
> ebooth@ppri.tamu.edu
> Office: +979.845.6754
> 


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