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: AW: output from mata:variance


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: output from mata:variance
Date   Sat, 6 Mar 2010 16:15:19 +0100

<> 



*************
sysuse auto, clear
mata:variance(vec(st_data(.,("mpg","length"))))

//get this result w/o -mata-
preserve
stack mpg length , into(newvar) clear
su n, d
local varmpglength=r(Var)
restore
di `varmpglength'
*************



HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Jon Schwabish
Gesendet: Samstag, 6. März 2010 01:39
An: statalist@hsphsun2.harvard.edu
Betreff: st: output from mata:variance

I'm using the -mata:variance- command to calculate the variance across (at
least) two variables. Specifically, for the two variable case, I am running
the following command:

mata:variance(vec(st_data(.,("r1","r2"))))

Is there any way to capture the output from the command in order to write it
to an output file (as in something stored in r() or e())? 

Thanks,
Jon

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