Stata Data Management

Takes raw files to an analysis-ready .dta that can be defended line by line. Covers import from csv, Excel and fixed width, the encode and destring decision, variable and value labels, Stata's numeric date representation, merge with reported match rates and a rule for every _merge value, joinby, append, reshape in both directions, duplicates and isid, missing value codes including extended missing, collapse against egen by group, xtset and panel structure checks including gaps and unbalanced panels, compress and saving with notes, and the rule that a raw file is never overwritten. Use this skill when someone is importing data into Stata, merging files, reshaping a panel, fixing identifiers that will not match, converting strings to numbers, handling missing value codes, building a panel dataset, or says the numbers changed after a merge, the observation count is wrong, or the data will not xtset. Trigger also on vague requests such as "get this into Stata", "my merge is dropping observations", or "why is my s

ingridleiria d8961a2 34.4 KB Updated

File contents

ingridleiria/breaktalk-skills/tree/main/phd-research/stata-data-management commit d8961a2704

Frequently asked questions

npx skillmds@latest add ingridleiria/stata-data-management