Statalist


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

Re: st: storing result inside a unix scripts


From   "Sergiy Radyakin" <[email protected]>
To   [email protected]
Subject   Re: st: storing result inside a unix scripts
Date   Tue, 22 Jan 2008 14:00:55 -0500

Hello Marco,

I am not sure if batch mode is really necessary here. Why don't you
loop the data files from within Stata in one do file, and then run
your processing do file. See help for foreach.

help foreach

-xml_tab- may be a useful command if you want to accumulate the
estimationg results from multiple estimations.

findit xml_tab

So the loop might look like this

foreach file in this.dta that.dta theother.dta {
    ** open file
    use "`file'"
    ** prepare variables, filter observations, run probit, etc
    do my-processing-do-file.do
    ** collect the results
    xmltab whatever_parameters
}


see also two other similar commands -outreg2- and -tabout-:

findit outreg2
findit tabout

Best regards, Sergiy


On 1/22/08, Marco Grazzi <[email protected]> wrote:
> Dear All!
>
> I am running a do file in Unix batch mode. I have used the suggestion
> on the FAQ: http://www.stata.com/support/faqs/unix/batch.html
> The .do file performs 3 simple probit regressions.
>
> The stata .do file is run within a 'for' cycle (i.e. it is running each
> time on a different database). At every loop, each time the stata
> do file is run, I want to store and append the results of these 3
> regression so that I can perform analysis afterwards (compute average,
> do some tests, etc). It is my understanding that I would need to
> perform this within the stata do file (probably with some pipe of
> strings, shell commands, or similar), but I don't really know how.
> Any help is greatly appreciated.
>
>
> Thanks a lot
>
> marco
>
>
> --
> Marco Grazzi
>
> --
>
> Post-Doc Fellow
> LEM - Scuola Superiore Sant'Anna
> Piazza Martiri della Liberta', 33
> 56127 Pisa, Italy
> Tel. +39-050-883341 Fax +39-050-883344
> Web site: https://mail.sssup.it/~grazzi
> *
> *   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/
>
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index