Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: repeat do-file over multiple files


From   "science" <[email protected]>
To   <[email protected]>
Subject   st: repeat do-file over multiple files
Date   Thu, 1 Mar 2012 20:19:45 +0100

Dear all,

I have 256 dta-files in a folder.
The structure is:
/Users/Stata/ProjectX/

subject_visit_number

001_02_01
001_02_02
001_07_01
001_07_02
002_02_01
etc.
That is 4 measurements for each subject (2 measurements at 2 visits)

The same do-file should be run on all 256 files and saved as 256 new files.

And lastly the 256 new files should be combined using append to one file.

My question is if that is possible and how it should be done?

Maybe the results from each of the 256 files can be stored in memory and just saved as 1 file.
The do-file ends with:
  collapse id visit nr tid vo2 vco2 rer ee antal1 antal2 antal3
which are the only data I would save from the files.
Does that make the job easier or better?

Thanks

Allan Stubbe
PhD-student
Aarhus University Hospital
Denmark
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index