← Back to Stata Index

Data Management Pillar

Import, types, joins, reshape, dates, and key validation patterns.

27 guides in this category

Start Here

Step 1

merge in Stata: 1:1, m:1, 1:m with Match Audits

Use merge stata in Stata with full runnable code, realistic panel variables, and QA checks before downstream estimation.

Step 2

import excel in Stata: Clean Types, Headers, Ranges, and Dates

Use import excel stata in Stata with full runnable code, realistic panel variables, and QA checks before downstream estimation.

Step 3

append in Stata: Stack Datasets Safely with Variable Alignment Checks

Use append stata in Stata with full runnable code, realistic panel variables, and QA checks before downstream estimation.

Step 4

Missing Values in Stata: ., .a-.z, and Safe Recode Rules

Use missing values stata in Stata with full runnable code, realistic panel variables, and QA checks before downstream estimation.

Step 5

bysort in Stata: Reusable Within-Group Transform Patterns

Use bysort stata in Stata with full runnable code, realistic panel variables, and QA checks before downstream estimation.

Step 6

Duplicates in Stata: report/list/drop with an Audit Checklist

Use duplicates drop stata in Stata with full runnable code, realistic panel variables, and QA checks before downstream estimation.

Step 7

tostring in Stata: Convert Without Breaking IDs and Merges

Use tostring stata in Stata with full runnable code, realistic panel variables, and QA checks before downstream estimation.

Step 8

recode in Stata: Safer Category Edits and Missing Handling

Use recode stata in Stata with full runnable code, realistic panel variables, and QA checks before downstream estimation.

Common Tasks

Troubleshooting

Command Index

append
append in Stata: Stack Datasets Safely with Variable Alignment Checks
bysort
bysort in Stata: Reusable Within-Group Transform Patterns
collapse
collapse in Stata: Group Summaries Without Losing Design Integrity
contract
contract in Stata: Frequency Tables You Can Merge Back
duplicates
Duplicates in Stata: report/list/drop with an Audit Checklist
egen
egen in Stata: Group IDs, Totals, Ranks, and Practical Cookbook Patterns
encode
encode vs egen group() in Stata: Correct Category IDs for Modeling
import
import excel in Stata: Clean Types, Headers, Ranges, and Dates
isid
isid in Stata: Enforce Key Uniqueness and Repair Failures
joinby
joinby in Stata: Many-to-Many Matching with Explicit Audits
keep
keep/drop in Stata: Subset Data Without Accidental Loss
label
Value Labels in Stata: label define, label values, and Label Hygiene
merge
merge in Stata: 1:1, m:1, 1:m with Match Audits
missing
Missing Values in Stata: ., .a-.z, and Safe Recode Rules
rangejoin
Range Joins in Stata: Match Rows Within Date and Value Intervals
recode
recode in Stata: Safer Category Edits and Missing Handling
reshape
reshape in Stata: Wide to Long and Back with Repeatable Patterns
sort
Sorting in Stata: sort, gsort, stable, and Tie Handling
stata
Stata Dates: daily(), %td, %tm, and Import Trap Fixes
summarize
summarize, detail in Stata: Percentiles, Skewness, and Checks
tabulate
tabulate in Stata: One-Way, Two-Way, Missing, and Percentages
tostring
tostring in Stata: Convert Without Breaking IDs and Merges
tsset
tsset in Stata: Time-Series Setup, Formats, and Duplicate Times
xtset
xtset in Stata: Panel IDs, Time Variables, and Gap Pitfalls

All Guides in This Category

Open full index
merge in Stata: 1:1, m:1, 1:m with Match Audits
reshape in Stata: Wide to Long and Back with Repeatable Patterns
import excel in Stata: Clean Types, Headers, Ranges, and Dates
append in Stata: Stack Datasets Safely with Variable Alignment Checks
collapse in Stata: Group Summaries Without Losing Design Integrity
egen in Stata: Group IDs, Totals, Ranks, and Practical Cookbook Patterns
encode vs egen group() in Stata: Correct Category IDs for Modeling
Stata Dates: daily(), %td, %tm, and Import Trap Fixes
Missing Values in Stata: ., .a-.z, and Safe Recode Rules
bysort in Stata: Reusable Within-Group Transform Patterns
Duplicates in Stata: report/list/drop with an Audit Checklist
tostring in Stata: Convert Without Breaking IDs and Merges
recode in Stata: Safer Category Edits and Missing Handling
Value Labels in Stata: label define, label values, and Label Hygiene
keep/drop in Stata: Subset Data Without Accidental Loss
joinby in Stata: Many-to-Many Matching with Explicit Audits
Range Joins in Stata: Match Rows Within Date and Value Intervals
merge keepusing() and keep(match) in Stata: Cleaner Joins
xtset in Stata: Panel IDs, Time Variables, and Gap Pitfalls
tsset in Stata: Time-Series Setup, Formats, and Duplicate Times
Sorting in Stata: sort, gsort, stable, and Tie Handling
Unique IDs in Stata: egen group(), isid, and Key Discipline
isid in Stata: Enforce Key Uniqueness and Repair Failures
contract in Stata: Frequency Tables You Can Merge Back
tabulate in Stata: One-Way, Two-Way, Missing, and Percentages
summarize, detail in Stata: Percentiles, Skewness, and Checks
import delimited in Stata: CSV Imports Without Type Breaks