Statalist


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

Re: Re: st: infix and dictionary files


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: Re: st: infix and dictionary files
Date   Fri, 29 Feb 2008 21:36:28 -0500

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index