[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: data formatted on cards
At 11:17 AM 7/1/2003 -0400, Patricia Pugliani wrote:
Knowing that it is fixed columns is one important step. The other
information you will need is what those columns are. For each variable
that you are interested in, you need to know its name, starting position,
length, and type -- plus which "line" it is on. The latter remark related
to the fact that there are 106 records ("lines") per case. That is, the
data are in groups of 106 lines; some variables are on line 1 within each
group, some are on line 2, and so forth.
I have complicated raw data that is formatted on "cards" and I cannot
determine how to make a dataset from these data.
This is the information that I have concerning these data:
PART NAME Merged 1976, 1981, and 1987 Data
FILE STRUCTURE rectangular
CASE COUNT 1,427
VARIABLE COUNT 4,080
RECORDS PER CASE 106
Can someone help me with this problem. I am a new Stata user and have only
used datasets up to this point, and not raw data. The data is in fixed
You will need to create a dictionary to describe how the variables are laid
out in the raw data file. That is, you will need to do an -infile- with a
dictionary, which you should see in the manual -- or type
(or if you prefer,
view help infile2
at the Stata command window.
Note that those variables on line 1 of every group of 106, should be
in your dictionary (but this is optional if they are at the beginning of
the dictionary). Those that are on line 2 of every group of 106 should be
and so forth (these are not optional).
(Those _line directives need only be written once before each group of
variables that are on the same line of the raw file and described together
in the dictionary.)
It is best to put
near the top of the dictionary.
(It is optional under certain circumstances, but best just to include it.)
I recommend to place
(fill in the starting column number) before every variable description.
The type of each variable should be specified in your dictionary. You will
also need to create input formats; those are determined by a combination of
type and length.
Institute for Policy Studies
Johns Hopkins University
* For searches and help try: