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   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   Re: st: Education CIP Codes with Label Define
Date   Thu, 08 Jan 2004 10:06:53 +0900

Apologies to John Milam and to the list for my too hasty last posting.  
-table-, but not -tabulate-, respects leading-zero numeric variable formatting. 

But I don't quiet follow John's statements about periods in value labels and in 
string variables:  Stata *does* accept periods in both value labels and in 
string variables, as illustrated below.

I don't understand the issue; is there might be something that John wants to do 
with the data that makes the periods in strings or in value labels problematic?

Joseph Coveney

-------------------------------------------------------------------------------

clear
set obs 2
generate float CIP_Code = 01.1110
replace CIP_Code = 0 in 2
format CIP_Code %07.4f
list, table noobs
table CIP_Code
*
*  value labels that contain periods
*
generate byte cod = _n
label define CIP_Codes 1 "01.1110" 2 "11.1111"
label values cod CIP_Codes
label variable cod "CIP Codes"
list cod, noobs table
tabulate cod
table cod
*
*  string variable that contains periods
*
generate str7 scod = "01.1110"
replace scod = "11.1111" in 2
label variable cod "Value-labeled"
label variable scod "String with dots"
tabulate scod cod
table cod, stubwidth(15)
table scod, stubwidth(16)
exit

--------------------------------------------------------------------------------




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