Home > Data Services > Catalog . Restricted Data . Census . ACS

Search Data Services

Meta Search
search across all the following databases:

Data Catalog
Data and documentation

KnowledgeBase
Common questions and answers.

Resources
Entire collection of data resources.


Latest Data News

RSS Feed icon

The Antidote for “Anecdata”: A Little Science Can Separate Data Privacy Facts from Folklore

Big Data: NYC Taxi Cab Trips

Getting A More Accurate Count Of Arab Americans

Measuring Race in the Census: Its Fluid

Expansion of Free Lunch Could Have a Negative Effect on Research Data

Data Services Knowledge Base

Q:  

I am having trouble merging selected files in the Health and Retirement Study (HRS). Some of the IDs are string variables and some are numeric. I am using stata.

I can convert the string ID to numeric with the following command:

generate HHIDNO = real(HHID);

However, when I try to convert the numeric ID back to string, something is not working and thus I cannot merge with the main file where the ID is a string variable. Here is the command I used to convert the numeric ID back to a string ID:

generate HHID = " " + string(HHIDNO);

A:  

When you converted the string ID to a numeric ID you dropped the original string ID. Don’t do this. Keep both versions of the ID in your original file. For merging, use whichever ID the ‘other’ data has (numeric or string).

Annotated Resources:

Direct Links:

Related Question Groups: