Agent skill · Audited from source
Stata Accounting Research
skill · brycewang-stanford/Auto-Empirical-Research-SkillsNOASSERTION licenceAudited 8 Oct 2026 · source e1ba289846fd
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit e1ba289846fd and found no filesystem, network or shell access and no hard-coded secrets. What it does: STATA code patterns for empirical accounting and finance research
Cite
Cite this page
ModelsAtlas. “Stata Accounting Research (brycewang-stanford/Auto-Empirical-Research-Skills)”. Retrieved 8 Oct 2026. https://modelsatlas.com/skills/brycewang-stanford/stata-accounting-research
Trust audit
Audit 0.4.1 · source read 8 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha e1ba289846fd · 8 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherbrycewang-stanford GitHub userOwner of the repository this skill is read from
- Source folderbrycewang-stanford/Auto-Empirical-Research-Skills/skills/43-wentorai-research-plugins/skills/domains/finance/stata-accounting-researchThe exact folder we audited
- LicenceNOASSERTIONAs the repository states it
- Commit pinned for this verdicte1ba289846fdA new audit runs when the source changes
- Repository statusNot archivedLast push 3 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: STATA code patterns for empirical accounting and finance research
---
name: stata-accounting-research
description: "STATA code patterns for empirical accounting and finance research"
metadata:
openclaw:
emoji: "📒"
category: "domains"
subcategory: "finance"
keywords: ["STATA", "accounting", "empirical finance", "panel data", "earnings management", "audit"]
source: "wentor-research-plugins"
---
# STATA Accounting Research Guide
## Overview
Empirical accounting research relies heavily on STATA for data manipulation, statistical analysis, and robustness testing. The field has developed standardized methodological approaches -- earnings quality models, event studies, difference-in-differences for regulatory changes, and instrument variable strategies for endogeneity -- that are implemented in a relatively stable set of STATA patterns.
This guide provides the core STATA code patterns used in top accounting journals (The Accounting Review, Journal of Accounting Research, Journal of Accounting and Economics, and Review of Accounting Studies). These patterns are drawn from commonly used research designs in financial reporting, auditing, tax, and managerial accounting research.
Whether you are estimating discretionary accruals, conducting an event study around an earnings announcement, testing the effect of auditor rotation on audit quality, or implementing a regulatory shock analysis, these patterns provide tested, reviewable STATA implementations.
## Data Preparation
### Loading and Cleaning COMPUSTAT Data
```stata
* ============================================================
* COMPUSTAT Annual Data Preparation for Accounting Research
* Standard preparation used across most empirical accounting papers
* ============================================================
* Load COMPUSTAT annual data
use "compustat_annual.dta", clear
* Keep relevant variables
keep gvkey fyear datadate at sale cogs xsga dp ib oancf act lct che dlc ///
csho prcc_f ceq re dltt txp xrd ppegt ppent invt rect
* Set panel structure
destring gvkey, replace
xtset gvkey fyear
* --- Basic cleaning ---
* Drop financial firms (SIC 6000-6999) and utilities (SIC 4900-4999)
drop if inrange(sic, 6000, 6999) | inrange(sic, 4900, 4999)
* Require minimum observations
bysort gvkey: gen nobs = _N
drop if nobs < 3
drop nobs
* --- Generate common variables ---
* Total accruals (balance sheet approach)
gen total_accruals = (D.act - D.che) - (D.lct - D.dlc) - dp
* Total accruals (cash flow approach, preferred)
gen total_accruals_cf = ib - oancf
* Scale by lagged total assets
gen lag_at = L.at
gen ta_scaled = total_accruals_cf / lag_at
gen sale_scaled = sale / lag_at
gen ppe_scaled = ppent / lag_at
gen dsale = D.sale / lag_at
gen drec = D.rect / lag_at
gen roa = ib / lag_at
* Market value of equity
gen mve = csho * prcc_f
* Book-to-market ratio
gen btm = ceq / mve
* Leverage
gen leverage = (dlc + dltt) / at
* Firm size
gen size = ln(at)
* --- Winsorize at 1% and 99% ---
foreach var of varlist ta_scaled sale_scaled ppe_scaled roa btm leverage size {
winsor2 `var', replace cuts(1 99)
}
* Label variables
label var ta_scaled "Total accruals / lagged assets"
label var roa "Return on assets"
label var btm "Book-to-market ratio"
label var leverage "Total debt / total assets"
label var size "Log(total assets)"
save "compustat_clean.dta", replace
```
## Earnings Quality Models
### Modified Jones Model (Dechow et al., 1995)
```stata
* ============================================================
* Modified Jones Model: Estimate discretionary accruals
* Standard model for earnings management research
* ============================================================
use "compustat_clean.dta", clear
* --- Step 1: Estimate non-discretionary accruals by industry-year ---
* Jones (1991) model estimated cross-sectionally
gen inv_lag_at = 1 / lag_at
gen dsale_drec = dsale - drec // Modified Jones adjustment
* Estimate by 2-digit SIC and year (require >= 15 obs per group)
gen sic2 = floor(sic / 100)
* Cross-sectional estimation
gen da_mj = .
gen nda_mj = .
levelsof fyear, local(years)
foreach y of local years {
levelsof sic2 if fyear == `y', local(industries)
foreach ind of local industries {
* Count observations in this industry-year
count if sic2 == `ind' & fyear == `y' & !missing(ta_scaled, inv_lag_at, dsale_drec, ppe_scaled)
if r(N) >= 15 {
* Estimate Jones model
quietly reg ta_scaled inv_lag_at dsale_drec ppe_scaled ///
if sic2 == `ind' & fyear == `y', robust
* Predict non-discretionary accruals
quietly predict temp_nda if sic2 == `ind' & fyear == `y', xb
quietly replace nda_mj = temp_nda if sic2 == `ind' & fyear == `y'
drop temp_nda
}
}
}
* Discretionary accruals = Total accruals - Non-discretionary accruals
replace da_mj = ta_scaled - nda_mj
* Absolute discretionary accruals (common measure of earnings quality)
gen abs_da = abs(da_mj)
label var da_mj "Discretionary accruals (Modified Jones)"
label var abs_da "Absolute discretionary accruals"
save "accruals_data.dta", replace
```
### Performance-Matched Discretionary Accruals (Kothari et al., 2005)
```stata
* ============================================================
* Kothari (2005): Performance-matched discretionary accruals
* Controls for correlation between performance and accruals
* ============================================================
* Add ROA to the Jones model
gen da_kothari = .
levelsof fyear, local(years)
foreach y of local years {
levelsof sic2 if fyear == `y', local(industries)
foreach ind of local industries {
count if sic2 == `ind' & fyear == `y' & !missing(ta_scaled, inv_lag_at, dsale_drec, ppe_scaled, roa)
if r(N) >= 15 {
quietly reg ta_scaled inv_lag_at dsale_drec ppe_scaled roa ///
if sic2 == `ind' & fyear == `y', robust
quietly predict temp_res if sic2 == `ind' & fyear == `y', residualExcerpt, first 6,001 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit e1ba289
git clone https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills git -C Auto-Empirical-Research-Skills checkout e1ba289846fd
The author documents no install command, so this uses the repository directly. Our verdict covers commit e1ba289846fd only.
Works in which agents?
What its own text says, not a test
| Agent | Status | More |
|---|---|---|
| OpenClaw | Mentioned in its text, not tested | Skills for OpenClaw · About OpenClaw |
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
e1ba289846fd
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/brycewang-stanford/stata-accounting-research/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All research skills →brycewang-stanford/Auto-Empirical-Research-Skills
GIS analysis and remote sensing workflows for geospatial research applications
brycewang-stanford/Auto-Empirical-Research-Skills
Run and manage Google Colab notebooks for Python and ML research
brycewang-stanford/Auto-Empirical-Research-Skills
Advanced Google Scholar search techniques for comprehensive literature discovery
brycewang-stanford/Auto-Empirical-Research-Skills
Ethical Google Scholar data collection techniques and best practices
brycewang-stanford/Auto-Empirical-Research-Skills
Autonomous agent for comprehensive deep research on any topic
brycewang-stanford/Auto-Empirical-Research-Skills
Practical advice for thriving in PhD programs and academic research
Add this badge to your README
[](https://modelsatlas.com/skills/brycewang-stanford/stata-accounting-research/)
<a href="https://modelsatlas.com/skills/brycewang-stanford/stata-accounting-research/"><img src="https://modelsatlas.com/skills/brycewang-stanford/stata-accounting-research/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Stata Accounting Research
What does the Stata Accounting Research skill do?
Is Stata Accounting Research safe to install?
What can Stata Accounting Research access on my machine?
Which assistants does Stata Accounting Research work with?
How current is this page?
Sources
- github.com/brycewang-stanford/Auto-Empirical-Research-Skills/tre — the audited source at commit e1ba289846fd and every finding aboveObserved · 8 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Stata Accounting Research skill do?
- Is Stata Accounting Research safe to install?
- What can Stata Accounting Research access on my machine?