Statalist


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

st: Reading data with multiple (and different number of) lines per observation


From   "Carolina Casas-Cordero" <[email protected]>
To   <[email protected]>
Subject   st: Reading data with multiple (and different number of) lines per observation
Date   Fri, 10 Apr 2009 17:31:29 -0400

Hi everybody,

I understand that Stata can read ASCII files with multiple lines per
observations (using infix) as long as each observation has exactly the
same number of lines (using lines #). 

In my dataset, the number of lines varies from observation to
observation. Im providing an example of how my raw data looks like
below. For each observation therere 3 pieces of information:
1.Household level data (84 characters long, in line 1)
2.Indicator of number of person-level records per household (4
characters long, in line 2)
3.Person level data (25 characters long, in lines 3+)

How can I tell Stata to take into account the variability in the number
of lines per observation?

Example of data structure:
---------------------------------------------------------------------------------
000010011800111 1140471504000000000 000001171993
4
0000005237208080100000000
0000005237249501000000000
0000005237257601100000000
0000005237309120100000000
000010011800111 1140471504000000000 000001171993
2
0000005237208080100000000
0000005237309120100000000
000010011800111 1140471504000000000 000001171993
3
0000005237208080100000000
0000005237257601100000000
0000005237309120100000000
000010011800111 1140471504000000000 000001171993
8
0000005237208080100000000
0000005237249501000000000
0000005237257601100000000
0000005237309120100000000
0000005237208080100000000
0000005237249501000000000
0000005237257601100000000
0000005237309120100000000
....etc
---------------------------------------------------------------------------------

I really appreciate your suggestions on how to handle this dataset!

Carolina









Carolina Casas-Cordero
PhD(c) 
The Joint Program of Survey Methodology
University of Maryland, College Park
Phone: (301) 314-7955 
Fax: (301) 314-7912


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index