Skip to content

Tidy the Next Steps Stata do-files - #12

Merged
ljwright merged 1 commit into
mainfrom
claude/next-steps-do-file-fixes
Nov 27, 2026
Merged

ljwright merged 1 commit into
mainfrom
claude/next-steps-do-file-fixes

Conversation

@ljwright

Copy link
Copy Markdown
Member

Four small changes to the downloadable Stata scripts for the Next Steps pages. The R code and the pages themselves are unchanged.

  • Data discovery: the lookup table is now built from the three Next Steps subfolders only. Previously it listed every .dta file under the working directory, which included datasets saved there by the other scripts. The temporary-file macros are now in double quotes, so the script also works when the path to Stata's temporary folder contains a space.
  • Household grid: removed a save "temp_mothers.dta" that nothing used.
  • Combining data across sweeps: corrected a comment (keep if _merge == x, not drop if).
  • Reshape: reworded the comment on the rename step, and height and weight are now created with gen double so no precision is lost.

The Next Steps section being prepared for the Stata site (CLS-Data/data-handling-stata) uses these same versions of the scripts, so the two sites stay identical.

Testing: all six Next Steps do-files were run in Stata (StataNow 19.5, batch mode) on made-up data that has the real file and variable names, with no errors. They have not been run on the real data.

🤖 Generated with Claude Code

- Data discovery: build the lookup table from the three Next Steps
  subfolders only, so other .dta files under the working directory (such
  as datasets saved by the other scripts) are not listed. Put the
  temporary-file macros in double quotes, so the script also works when
  the path to Stata's temporary folder contains a space.
- Household grid: remove a save of temp_mothers.dta that nothing used.
- Combining data across sweeps: correct a comment (keep if, not drop if).
- Reshape: reword the comment on the rename step, and create height and
  weight with gen double so no precision is lost.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@ljwright
ljwright merged commit 7cdc23a into main Nov 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant