Question

Status:Closed    Asked:Jul 24, 2016 - 04:34 PM

Are the variable names in the Stata .dta file upper case or lower case?

Dear Folks--

The IPUMS-CPS variable names as they appear on the IPUMS-CPS web pages, in the .dat fixed-width files, in the .csv files, in the codebook, and in the xtml documentation are upper case. The variable names as they appear in the Stata .do file are lower case.

The R package "haven" converts .dta files to R data frames. R is case sensitive: HHINCOME does not equal hhincome. The variable names in the data frame as it emerges from haven are lower case. Is that because haven is converting them to lower case? (It shouldn't). Or is it because you are sending the .dta files out with a different case than other files? And if the latter, was that intentional (and if so, why?) or unintensional (and if so, will you be changing it any time soon?).

Warmest regards, Andrew

 
Do you have the same question? Follow this Question
 

Staff Answer

avatar

Joe_Grover

Staff

The lowercase variable names in Stata extracts and syntax files is intentional. This is because the Stata convention is to name variables using all lowercase characters. While this is not enforced by the Stata program it is common practice among most users so this is what we support.

I hope this helps.

 

Jul 25, 2016 - 02:10 PM

0
0
Report it

OTHER QUESTIONS NEEDING ANSWERS

Sampling variability associated with case?
Do SAS and STATA "command files" transform any "Fixed Width Text Files/Data" ...
Why are variable names different?
documentation linking CPS variable names and IPUMS-CPS variable names
Login   |   Register

Recently Active Members

View More »

Share |