Statalist


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

st: Matrix command - vecdiag?


From   tiago.pereira@incor.usp.br
To   statalist@hsphsun2.harvard.edu
Subject   st: Matrix command - vecdiag?
Date   Sun, 2 Sep 2007 19:18:41 -0300 (BRT)

Dear Statalisters,

I have the following do file (and a lot of .dta files):


clear
set obs 100
tempname M
forvalues i = 1/100 {
forvalues u = 1(0.1)1.6  {
	use "C:\TEST\RR=`u'_replication_number_`i'.dta"
	set more off
	quietly summarize A
	matrix `M' = nullmat(`M') \ ( r(mean),  r(N))
        clear
}
}
svmat double `M' , name(results)


-svmat- saves results as:

results1 results2
1.2 56
1.3 85


Nonetheless, I would like to add to the matrix a third collumm, which will
have the name of the .dta file. For example,

results1 results2 results3
1.2 56 RR=1.2_replication_number_1.dta
1.3 85 RR=1.2_replication_number_2.dta
.
.
.

Is this difficult to do without changing much my simple do file? I have
tried the vecdiag option, unsuccessfully, however.

I will be very grateful for any help again.

Best,

Tiago




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