Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: Re: st: infix and dictionary files


From   "Norbert Michel" <[email protected]>
To   <[email protected]>
Subject   Re: Re: st: infix and dictionary files
Date   Fri, 29 Feb 2008 20:56:37 -0600

Austin, I apologize for sending you the large file - since I basically pasted the beginning and end (just a few lines) of what was in my dictionary file, I thought I'd just send the whole thing. Again, my apolgies - and I appreciate the help.

The problem with the insheet command is that it reads in 207 variables, but leaves out the next 600 or so.  This is why I've been trying to use the start positions with the infix command.

And, I guess I'm an idiot, because I still can't get this to run.

I changed my dct file to read: 
infix dictionary using fmlyi041x.txt

Still, no dice.  Stata doesn't need the path? Do I need to have these files saved in a particular place?

>>> "Austin Nichols" <[email protected]> 02/29/08 8:36 PM >>>
Norbert--
You sent me a large raw data file and a dct file instead of posting a
small example as I suggested (easily generated by copying the first
few lines of the dct file and the first few lines of the raw data).
The dct file begins with the words "inifx dictionary" --if "inifx
dictionary ... {" below is modified to read "infix dictionary using
fmlyi041x.txt {" the -infix- command runs without error.

inifx dictionary using
C:\Users\Norbert\Documents\CEX\2004\Intrvw04\fmlyi041x.txt {
NEWID	1	-	8
AGE_REF	11	-	12
AGE_REF_	13	-	13
AGE2	14	-	15
AGE2_	16	-	16
AS_COMP1	26	-	27
}

However, the -infix- approach as written does not specify any string
variables, and the dictionary file does not match the variable names
that appear in the first line of the data file, so an -insheet-
command gives very different results:

. qui infix using tryover_rev in 1/10
. li  NEWID- AS_COMP1, noo

  +--------------------------------------------------------+
  |   NEWID   AGE_REF   AGE_REF_   AGE2   AGE2_   AS_COMP1 |
  |--------------------------------------------------------|
  |       .         .          .      .       .          . |
  | 1383835         .          .      .       .          . |
  | 1383865         .          .      .       .          . |
  | 1383875         .          .      .       .          . |
  | 1383885         .          .      .       .          . |
  |--------------------------------------------------------|
  | 1383895         .          .      .       .          . |
  | 1383905         .          .      .       .          . |
  | 1383915         .          .      .       .          . |
  | 1383925         .          .      .       .          . |
  | 1383935         .          .      .       .          . |
  +--------------------------------------------------------+

.  clear
. insheet using fmlyi041x.txt
(207 vars, 7976 obs)
. li  newid-earncomp in 1/10, noo

  +-----------------------------------------------------------+
  |   newid   age_ref   age2   bls_urbn   cutenure   earncomp |
  |-----------------------------------------------------------|
  | 1383835        70      .          1          2          4 |
  | 1383865        50     47          1          2          2 |
  | 1383875        47      .          1          4          1 |
  | 1383885        44     45          1          1          2 |
  | 1383895        52      .          1          4          1 |
  |-----------------------------------------------------------|
  | 1383905        34      .          1          1          1 |
  | 1383915        49      .          1          4          1 |
  | 1383925        47      .          1          1          1 |
  | 1383935        71     79          1          1          8 |
  | 1383945        69      .          2          2          4 |
  +-----------------------------------------------------------+


On Fri, Feb 29, 2008 at 5:49 PM, Norbert Michel
<[email protected]> wrote:
> Austin, I didn't want to post attachments, so I'm sending directly to you.
>
>  I've attached the text file with my data, and the dictionary file I'm using.  At the end of the dictionary file, I've pasted (as a comment) the line that I'm using at stata's command window.
>
>  I don't know if I'm saving something incorrectly or what is going on, but I'm getting the same error.
>
>  Norbert
>
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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