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: RE: data management question


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: data management question
Date   Fri, 15 Oct 2010 17:48:56 +0100

If this were my problem, I would certainly start off thinking about -file-. I might include an -outsheet- to send the data to a temporary file and then also read them in using -file-. As you say, -filefilter- also seems natural. 

Much depends on whether this is an absolutely fixed design imposed on you. 

Nick 
n.j.cox@durham.ac.uk 

Airey, David C

I need to automate the creation of many tab delimited text (ascii) files.

The structure is:

# comments
# comments
# comments
# comments
@format=column var1 se n var2 se n var3 se n
1 10 2 8 50 5 8 x x x
2 11 1.9 8 50 5 8 30 3 8
3 12 1.7 8 50 5 8 30 3 8
4 13 2 8 50 5 8 30 3 8
5 18 2.1 8 50 5 8 30 3 8

etc

Problems with this file format are use of "x" for missing, column naming 
conventions not compatible with Stata (@ symbol, repeated column names), 
use of # for header comments.

-Outfile- or -outsheet- can export the data from underneath 
the @ line just fine, and maybe -filefilter- can change the missing data to "x" as 
needed. Should -file- be somehow used to create the file up to the @ line and then 
-outsheet- below and then somehow join the two?

How do others handle the creation of data files that have nonstandard header text?


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