Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Education CIP Codes with Label Define


From   "John Milam" <[email protected]>
To   <[email protected]>
Subject   RE: st: Education CIP Codes with Label Define
Date   Thu, 8 Jan 2004 09:36:20 -0500

Nick,

You are right in the example I included.  I would like then to change it
from string to numeric.  But I don't know how to treat the padding of
leading/trailing zeros and the period which will then treat the number
as having 4 decimals.

Please advise. Many thanks,
John


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nick Cox
Sent: Thursday, January 08, 2004 9:26 AM
To: [email protected]
Subject: RE: st: Education CIP Codes with Label Define

I have not been following this thread closely,
but you are inputting -cipcode- as string here.
That being so, you cannot define labels for it,
or assign a numeric format to it.

I guess you're importing presuppositions from
other packages into your Stata syntax.

Nick
[email protected]

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of John Milam
> Sent: 08 January 2004 14:16
> To: [email protected]
> Subject: RE: st: Education CIP Codes with Label Define
>
>
> Joseph,
>
> Thanks for your help.  I must not have explained the issue
> adequately.
> I will play with the formatting of trailing and leading zeroes in a
> numeric label.  But The period such as 01.1110 is in the
> label code not
> in the label value.  Running STATA 8.2, I keep getting
> syntax errors.
> ___________________________
> Data file:
>
> unitid,"instnm",idx_c,majornum,"cipcode",awlevel,crace15f,crace16f
> 232186,"UNIVERSITY X",-2,1,"99.0000",5,1118,1694
> 232186,"UNIVERSITY X",-2,1,"01.1110",5,3,5
> ___________________________
> STATA Program:
>
> insheet using "c:\dct\test.csv", comma clear
> label data "test"
> label variable unitid "UNITID"
> label variable instnm "Institution Name"
> label variable idx_c "UNITID number of parent institution
> completions"
> label variable majornum "First or Second Major"
> label variable cipcode "CIP Code"
> label variable awlevel "Award Level code"
> label variable crace15f "Grand total men"
> label variable crace16f "Grand total women"
> label define label_majornum 1 "First major" 2 "Second major"
> label values majornum label_majornum
> label define label_cipcode "01.1110" "Something different for test"
> 99.0000 "Award"
> label values cipcode label_cipcode
> label define label_awlevel 1 "Awards of less than one
> academic year" 2
> "Awards at least 1 but less than 2 academ" 3 "Associates degrees" 4
> "Awards at least 2 but less than 4 academ" 5 "Bachelors degrees" 6
> "Postbaccalaureate certificates" 7 "Masters degrees" 8 "Post-Masters
> certificates" 9 "Doctors degrees" 10 "First-professional degrees" 11
> "First-professional certificates"
> label values awlevel label_awlevel
> tab majornum
> tab cipcode
> tab awlevel
> summarize crace15f
> summarize crace16f
> save test
> ___________________________
> Results:
>
> . label define label_cipcode "01.1110" "Something different
> for test"
> 99.0000 "Award"
> invalid syntax
> r(198);
> ___________________________
> How can I pad the CIP Code value label code as a numeric
> variable, with
> the leading and trailing zeroes?  Is it simply:
>
> .format CIP_Code %07.4f
>
> Do I have to generate it as a float first?
>
> Thanks,
> John
>
> John Milam, Ph.D.
> Managing Director
> HigherEd.org, Inc.
> 9 West Piccadilly St.
> Winchester, VA 22601
> (540) 722-6060 (voice)
> (540) 722-6163 (fax)
> [email protected]
> http://highered.org
>
>
>
>
>
> *
> *   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/



*
*   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