Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: labels and #delimit
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: labels and #delimit
Date
Mon, 16 Jan 2012 23:43:23 +0000
In your sample code the -infile- line can't be run by us as we don't
have the file in question; that does not appear problematic. The
-label- definition for F0001_ is corrupted; presumably you would have
a corresponding error.
I ran a sample do file with definitions for the other two labels and
the labels show up fine with -label dir- and -label li-.
I can thus find nothing problematic in your code and cannot support
your hypothesis that the delimiter is problematic.
Nick
On Mon, Jan 16, 2012 at 11:28 PM, Stephen Porter <[email protected]> wrote:
> Hi all,
>
> I'm trying to use a dataset created by the Dept of Education, using the do
> files they provide to researchers. The data loads fine; however, the value
> labels do not seem to work.
>
> Here is a sample of the code:
>
> infile using "C:\data\student.dct"
> #delimit ;
> label define F0001_
> 0 "No"
> 1 "Yes"
> -7 "Item legitimate skip/NA"
> -on-response/component not applicable"
> -9 "Missing"
> ;
> label define F0002_
> 0 "No"
> 1 "Yes"
> 2 "Haven't decided yet"
> 3 "Don't know what a test for the IB is"
> -7 "Item legitimate skip/NA"
> -8 "Unit non-response/component not applicable"
> -9 "Missing"
> ;
> label define F0003_
> 0 "No"
> 1 "Yes"
> 2 "Haven't decided yet"
> 3 "Don't know what an Adv Placement test is"
> -7 "Item legitimate skip/NA"
> -8 "Unit non-response/component not applicable"
> -9 "Missing"
> ;
> #delimit cr
>
> The command 'label dir' returns nothing when this code is run; in fact,
> no commands in the do file will run after the label section. Each label
> runs fine when entered on the command line, so I figure it must be
> something with the delimiter.
>
*
* 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/