Stata Data Cleaning
meleantonio/awesome-econ-ai-stuff
Clean and transform messy data in Stata with reproducible workflows
Clean, transform, and validate messy research data using Stata
$ npx skills add wentorai/research-plugins --skill stata-data-cleaning -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install wentorai/research-plugins stata-data-cleaning --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/analysis/wrangling/stata-data-cleaning .claude/skills/stata-data-cleaning && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "stata-data-cleaning" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/analysis/wrangling/stata-data-cleaning into .claude/skills/stata-data-cleaning/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "stata-data-cleaning", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/wentorai/research-plugins/tree/main/skills/analysis/wrangling/stata-data-cleaningType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add wentorai/research-plugins --skill stata-data-cleaning -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install wentorai/research-plugins stata-data-cleaning --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/analysis/wrangling/stata-data-cleaning .agents/skills/stata-data-cleaning && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "stata-data-cleaning" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/analysis/wrangling/stata-data-cleaning into .agents/skills/stata-data-cleaning/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "stata-data-cleaning", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wentorai/research-plugins --skill stata-data-cleaning -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install wentorai/research-plugins stata-data-cleaning --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/analysis/wrangling/stata-data-cleaning .cursor/skills/stata-data-cleaning && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "stata-data-cleaning" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/analysis/wrangling/stata-data-cleaning into .cursor/skills/stata-data-cleaning/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "stata-data-cleaning", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/wentorai/research-plugins.git --path skills/analysis/wrangling/stata-data-cleaning--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add wentorai/research-plugins --skill stata-data-cleaning -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install wentorai/research-plugins stata-data-cleaning --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/analysis/wrangling/stata-data-cleaning .gemini/skills/stata-data-cleaning && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "stata-data-cleaning" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/analysis/wrangling/stata-data-cleaning into .gemini/skills/stata-data-cleaning/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "stata-data-cleaning", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install wentorai/research-plugins stata-data-cleaningInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add wentorai/research-plugins --skill stata-data-cleaning -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/analysis/wrangling/stata-data-cleaning .github/skills/stata-data-cleaning && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "stata-data-cleaning" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/analysis/wrangling/stata-data-cleaning into .github/skills/stata-data-cleaning/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "stata-data-cleaning", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wentorai/research-plugins --skill stata-data-cleaning -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install wentorai/research-plugins stata-data-cleaning --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/analysis/wrangling/stata-data-cleaning .opencode/skills/stata-data-cleaning && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "stata-data-cleaning" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/analysis/wrangling/stata-data-cleaning into .opencode/skills/stata-data-cleaning/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "stata-data-cleaning", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
stata-data-cleaningClean, transform, and validate messy research data using Stata
Stata Data Cleaning is an agent skill from wentorai/research-plugins. Clean, transform, and validate messy research data using Stata
Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Research & Science, covering Econometrics and empirical research and Data cleaning. The repository describes itself as: 350+ academic research skills, MCP configs, and plugins for Research-Claw and AI agents. The licence is MIT.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit bf44b3c. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are stata).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
stata.comdimewiki.worldbank.orgpovertyactionlab.orgFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Stata Data Cleaning loads about 2.1k tokens when it runs. Until then it costs about 21 tokens; SKILL.md has 359 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from wentorai/research-plugins at commit bf44b3c, republished under its MIT licence (© wentorai). 359 words, ~2,150 tokens.
.claude/skills/stata-data-cleaning/SKILL.md (or your agent's skills folder).Clean, transform, and validate messy research datasets in Stata. This skill covers the complete data preparation pipeline from raw survey or administrative data to analysis-ready datasets, with emphasis on documentation, reproducibility, and handling the common data quality issues encountered in social science, economics, and health research.
Data cleaning typically consumes 60-80% of research time in empirical studies, yet it is often under-documented and poorly reproducible. Stata provides a powerful set of commands for data manipulation, but knowing which commands to use and in what order requires experience with common data quality issues: inconsistent coding, duplicate observations, string formatting problems, implausible values, and complex missing data patterns.
This skill provides a systematic, step-by-step data cleaning workflow in Stata. Each step produces a log of changes made, enabling full reproducibility and audit trails. The workflow is organized around the principle that raw data should never be modified in place -- instead, cleaning scripts transform raw data into processed datasets while preserving the original.
The approach follows best practices from the World Bank's DIME Analytics team and the J-PAL research transparency guidelines, making it suitable for projects that require rigorous data documentation for peer review, replication packages, or regulatory compliance.
* ============================================
* Data Cleaning Script: [Project Name]
* Author: [Name]
* Date: [Date]
* Input: raw/survey_data_raw.dta
* Output: processed/survey_data_clean.dta
* ============================================
clear all
set more off
log using "logs/cleaning_log.smcl", replace
* Load raw data
use "raw/survey_data_raw.dta", clear
* Basic inspection
describe
summarize
codebook, compact
* Check dimensions
display "Observations: " _N
display "Variables: " c(k)
* Check for duplicates on ID variable
duplicates report respondent_id
duplicates list respondent_id if duplicates(respondent_id) > 0* Generate a data quality summary
foreach var of varlist _all {
quietly {
count if missing(`var')
local nmiss = r(N)
local pctmiss = (`nmiss' / _N) * 100
}
if `pctmiss' > 0 {
display "`var': `nmiss' missing (`pctmiss'%)"
}
}
* Check value ranges for numeric variables
foreach var of varlist age income years_education {
summarize `var', detail
* Flag implausible values
count if `var' < 0 & !missing(`var')
count if `var' > 150 & !missing(`var')
}* Trim whitespace
replace name = strtrim(name)
replace name = stritrim(name) // Remove internal multiple spaces
* Standardize case
replace city = proper(city) // Title case
replace country = upper(country) // Upper case
replace email = lower(email) // Lower case
* Remove special characters
replace phone = ustrregexra(phone, "[^0-9]", "")
* Fix encoding issues
replace name = ustrfix(name)
* Standardize common variations
replace department = "Computer Science" if ///
inlist(department, "CS", "Comp Sci", "Comp. Sci.", "CompSci")
replace gender = "Female" if inlist(gender, "F", "f", "female", "FEMALE")
replace gender = "Male" if inlist(gender, "M", "m", "male", "MALE")* Split full name into first and last
gen first_name = word(full_name, 1)
gen last_name = word(full_name, -1)
* Extract year from date string "March 15, 2024"
gen year = real(word(date_string, -1))
* Parse numeric values from strings like "$1,234.56"
gen income_clean = real(subinstr(subinstr(income_str, "$", "", .), ",", "", .))* Install missing data analysis tools
ssc install mdesc
ssc install misstable
* Summary of missing data
mdesc
* Missing data patterns
misstable summarize
misstable patterns
* Create missing indicator variables
foreach var of varlist income education occupation {
gen mi_`var' = missing(`var')
}
* Test whether missing is random (Little's MCAR test approximation)
* Compare means of observed variables by missing status
foreach var of varlist income education {
ttest age, by(mi_`var')
ttest gender_numeric, by(mi_`var')
}* Common survey codes for missing
* -99 = refused, -88 = don't know, -77 = not applicable
foreach var of varlist income satisfaction trust_score {
replace `var' = .r if `var' == -99 // .r = refused
replace `var' = .d if `var' == -88 // .d = don't know
replace `var' = .n if `var' == -77 // .n = not applicable
}
* Extended missing values preserve the reason for missingness
* while still being treated as missing in analyses* Create age groups
recode age (18/29 = 1 "18-29") (30/44 = 2 "30-44") ///
(45/59 = 3 "45-59") (60/max = 4 "60+"), gen(age_group)
* Create binary indicator
gen high_income = (income > 75000) if !missing(income)
* Create composite scale (e.g., Likert items)
alpha item1 item2 item3 item4 item5, gen(scale_score) item
* Cronbach's alpha is reported; scale_score is the mean
* Standardize continuous variables
foreach var of varlist income education_years age {
egen z_`var' = std(`var')
}
* Winsorize extreme values
winsor2 income, cuts(1 99) replace* Parse date strings
gen interview_date = date(date_string, "MDY")
format interview_date %td
* Extract components
gen interview_year = year(interview_date)
gen interview_month = month(interview_date)
gen interview_dow = dow(interview_date) // 0=Sunday
* Calculate durations
gen days_since_treatment = interview_date - treatment_date
gen months_since = (interview_date - treatment_date) / 30.44* These assertions halt execution if violated
assert _N == 5000 // Expected sample size
assert !missing(respondent_id) // No missing IDs
assert age >= 18 & age <= 120 if !missing(age) // Plausible age range
assert inlist(gender, "Male", "Female", "Other", "") | missing(gender)
* Cross-variable consistency checks
assert education_years >= 0 if !missing(education_years)
assert income >= 0 if !missing(income)
assert end_date >= start_date if !missing(end_date) & !missing(start_date)* Identify duplicates
duplicates tag respondent_id, gen(dup_flag)
list respondent_id survey_date if dup_flag > 0, sepby(respondent_id)
* Keep most recent observation per respondent
bysort respondent_id (survey_date): keep if _n == _N
* Or keep first observation
bysort respondent_id (survey_date): keep if _n == 1* Label all variables
label variable age "Age at time of interview (years)"
label variable income "Annual household income (USD)"
label variable education_years "Total years of formal education"
* Save cleaned dataset
compress // Reduce file size
save "processed/survey_data_clean.dta", replace
* Export codebook
codebook, compact
describe, short
* Close log
log closelog using to capture all output for audit trails.© wentorai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/analysis/wrangling/stata-data-cleaning of wentorai/research-plugins.
Open the folder on GitHubat commit bf44b3c
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in wentorai/research-plugins, which our catalogue first saw on October 7, 2026.
Stata Data Cleaning next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Stata Data Cleaning this skillwentorai/research-plugins | 298 | 1 repos | ~2.1k | Automated safety check: Pass | MIT | |
| Stata Data Cleaningmeleantonio/awesome-econ-ai-stuff | 646 | 2 repos | ~1.8k | Automated safety check: Pass | Custom licence | |
| Data Cleaningbrycewang-stanford/Auto-Empirical-Research-Skills | 4.6k | — | ~2.9k | Automated safety check: Pass | Custom licence | |
| CHARLS Paper Reproduction Guidexjtulyc/MedgeClaw | 617 | 1 repos | ~1.8k | Automated safety check: Pass | None | |
| Example Datasetspymc-labs/CausalPy | 1.2k | — | ~587 | Automated safety check: Pass | Apache-2.0 | |
| Daily PapersXiangyue-Zhang/auto-deep-researcher-24x7 | 1.3k | — | ~309 | Automated safety check: Pass | Apache-2.0 |
meleantonio/awesome-econ-ai-stuff
Clean and transform messy data in Stata with reproducible workflows
brycewang-stanford/Auto-Empirical-Research-Skills
Clean and transform messy data for analysis in Python, R, or Stata
xjtulyc/MedgeClaw
Guides an agent through reproducing papers built on the CHARLS health and retirement survey, from variable mapping to cognition, depression and isolation scores.
pymc-labs/CausalPy
Load built-in CausalPy example datasets for demos, tutorials, tests, and quick causal-analysis prototypes.
Xiangyue-Zhang/auto-deep-researcher-24x7
Daily arXiv paper recommendations with automatic deduplication
aspi6246/Claude-Code-Skills-for-Academics
Systematic dataset profiling protocol for empirical research.
wentorai/research-plugins
Craft structured research abstracts that maximize clarity and journal acceptance
wentorai/research-plugins
Manage academic citations across BibTeX, APA, MLA, and Chicago formats
wentorai/research-plugins
Summarize academic papers with structured extraction of key elements
wentorai/research-plugins
Evidence-based study techniques for academic learning and retention
wentorai/research-plugins
Adjust writing tone and register for academic audiences and venues
wentorai/research-plugins
Academic translation, post-editing, and Chinglish correction guide
Categories
Clean, transform, and validate messy research data using Stata. Stata Data Cleaning is an agent skill from wentorai/research-plugins.
Stata Data Cleaning fits situations like: tasks that involve Econometrics and empirical research; tasks that involve Data cleaning.
Run `npx skills add wentorai/research-plugins --skill stata-data-cleaning -a claude-code`. Or copy the skill folder (skills/analysis/wrangling/stata-data-cleaning in wentorai/research-plugins) into .claude/skills/stata-data-cleaning in your project. Claude Code loads it when a task matches its description.
Run `npx skills add wentorai/research-plugins --skill stata-data-cleaning -a codex`. Or copy the skill folder (skills/analysis/wrangling/stata-data-cleaning in wentorai/research-plugins) into .agents/skills/stata-data-cleaning in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wentorai/research-plugins --skill stata-data-cleaning -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/stata-data-cleaning, .gemini/skills/stata-data-cleaning, .github/skills/stata-data-cleaning and .opencode/skills/stata-data-cleaning in your project.
SKILL.md names no scripts, command-line tools or credentials: Stata Data Cleaning is instructions for the agent only.
SKILL.md names 3 domains. As links in the text: stata.com, dimewiki.worldbank.org and povertyactionlab.org. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Stata Data Cleaning is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.1k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Stata Data Cleaning: Stata Data Cleaning (meleantonio/awesome-econ-ai-stuff, 646 stars), Data Cleaning (brycewang-stanford/Auto-Empirical-Research-Skills, 4.6k stars), CHARLS Paper Reproduction Guide (xjtulyc/MedgeClaw, 617 stars) and Example Datasets (pymc-labs/CausalPy, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
wentorai (a GitHub user) maintains it in wentorai/research-plugins, which has 298 GitHub stars. The repository holds 405 skills in this directory. The repository was last updated on June 19, 2026.
Source: wentorai/research-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.