Home  /  Resources & support  /  FAQs  /  Data management

Data management

FAQ:   Data management
Search the FAQs: spacer.gif spacer.gif

Questions are listed below in the following categories:

  1. Reading and inputting data
  2. Combining datasets
  3. Memory usage
  4. Data manipulation
    4.1   Variable creation
    4.2   Short-cuts
    4.3   Puzzling results
    4.4   Dataset manipulation
    4.5   Replacing values or observations
  5. Data reporting
  6. Other
  7. FAQs concerning releases before Stata 18

1. Reading and inputting data

2. Combining datasets

3. Memory usage

4. Data manipulation

4.4 Dataset manipulation

How do I convert my ICD-9 codes from a string type to a numeric type?

How do I check a variable for a range of diagnosis or procedure codes?

How do I label my diagnosis or procedure codes with their descriptions?

How do I calculate the maximum or minimum seen so far in a sequence?

What are regular expressions and how can I use them in Stata?

How do I remove leading or trailing zeros from string variables?

How do I go through the groups of a variable in order of their first occurrence in the dataset?

How can I drop spells of missing values at the beginning and end of panel data?

Is there a way to tell Stata to try all values of a particular variable in a foreach statement without specifying them?

I want to calculate a variable containing weighted group summary statistics, but I do not want to collapse the data and egen does not support weights. How can I do this?

How do I deal with multiple responses?

How can I collapse my dataset and keep the same variable labels?

How do I identify runs of consecutive observations in panel data?

How do I select a subset of observations using a complicated criterion?

How can I save one or more parts of a large dataset?

How do you efficiently define group characteristics in your data in order to create subsets?

How do I perform multiple operations on data records if a condition is met?

I am having problems with the reshape command. Can you give further guidance?

How do I produce a dataset based on all possible pairs of identifiers within each group?

Why doesn't the destring command in Stata include an encode option?

How can I create a dataset (matrix) of means (other stats) of variables from the current dataset?

How do I implement SAS-like ARRAYs in Stata?

5. Data reporting

6. Other

7. FAQs concerning release before Stata 18