Statalist


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

st: Why did not the infile with dictionary work?


From   Ekaterina Hertog <ekaterina.hertog@sociology.ox.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: Why did not the infile with dictionary work?
Date   Sun, 16 Aug 2009 16:37:04 +0100

Dear all I have been attempting to infile some data from a txt file and Stata 10 did not do it correctly and I cannot figure out why. I was wondering if anyone have came across such an error and might be able to advice me what went wrong.
The data in the .txt file looks as follows:
1010300310	2	1	9	9	11	20	??	??1010620290	2	1	12	11	??	??	??	??1010720283	2	1	13	??	??	??	??	??1010720742	2	1	13	9	11	??	??	??1010800458	2	1	9	??	??	??	??	??1010820403	2	1	9	13	11	??	??	??1010920657	2	1	12	??	??	??	??	??1010920681	2	1	12	10	??	??	??	??1010920998	2	1	11	12	12	12	11	??1011020171	2	1	13	12	??	??	??	??
The first variable is a unique individual identifier and the others are types of family members (1=mother, 2=father etc), ?? stands for a missing value.
I created the following dictionary file called fammem.dct:
dictionary using fammem.txt {
     custnmb fammem1 fammem2 fammem3 fammem4 fammem5 fammem6 fammem7 fammem8 fammem9 fammem10
}

And then wrote in my do file: infile using fammem
Stata appeared to infile normally reading figures as numerical values and ?? as missing values. The resulting dataset had the same number of observations as the txt file. When I started checking it however I realised that (seemingly randomly) Stata did not infile some of the observations and infiled several identical copies of others. I cannot find the reason why.

When I tried infiling the same dataset without a dictionary, by typing the following:
insheet custnmb fammem1 fammem2 fammem3 fammem4 fammem5 fammem6 fammem7 fammem8 fammem9 fammem10 using fammem.txt, tab
it worked perfectly well.
I would be most grateful for any advice as to what did I do wrong when infiling with a dictionary,
Sincerely yours,
Ekaterina




-- 
Ekaterina Hertog (nee Korobtseva)
Nissan Institute of Japanese Studies
27 Winchester Road, Oxford
OX2 6NA

*
*   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   |   What's new   |   Site index