writing-skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
review-data-analysisReview a data analysis for quality, correctness, and reproducibility. Covers data quality assessment, assumption checking, model validation, data leakage detection, and reproducibility verification. Use when reviewing a colleague's analysis before publication, validating an ML pipeline before production deployment, auditing a report for regulatory or busine…
Independent GitHub snapshot · Automated classification · Original documentation governs
評資料分析管線之正確性、穩健性與可重現性。
評分析之前先評輸入資料:
## Data Quality Assessment
### Completeness
- [ ] Missing data quantified (% by column and by row)
- [ ] Missing data mechanism considered (MCAR, MAR, MNAR)
- [ ] Imputation method appropriate (if used) or complete-case analysis justified
### Consistency
- [ ] Data types match expectations (dates are dates, numbers are numbers)
- [ ] Value ranges are plausible (no negative ages, future dates in historical data)
- [ ] Categorical variables have expected levels (no misspellings, consistent coding)
- [ ] Units are consistent across records
### Uniqueness
- [ ] Duplicate records identified and handled
- [ ] Primary keys are unique where expected
- [ ] Join operations produce expected row counts (no fan-out or drop)
### Timeliness
- [ ] Data vintage appropriate for the analysis question
- [ ] Temporal coverage matches the study period
- [ ] No look-ahead bias in time-series data
### Provenance
- [ ] Data source documented
- [ ] Extraction date/version recorded
- [ ] Any transformations between source and analysis input documented
預期: 資料品質問題已記錄,附其對結果之潛在影響。 失敗時: 若資料不可達以資評審,自代碼評品質(施何檢查與轉換)。
對所用之每統計法或模型:
| 法 | 主要假設 | 如何檢 |
|---|---|---|
| 線性回歸 | 線性、獨立、殘差常態、同方差 | 殘差圖、Q-Q 圖、Durbin-Watson、Breusch-Pagan |
| 邏輯回歸 | 獨立、無多重共線、線性 logit | VIF、Box-Tidwell、殘差診斷 |
| t-test | 獨立、常態(或大 n)、方差等 | Shapiro-Wilk、Levene's test、目視 |
| ANOVA | 獨立、常態、方差同質 | 每組 Shapiro-Wilk、Levene's test |
| 卡方 | 獨立、預期頻率 ≥ 5 | 預期頻率表 |
| 隨機森林 | 訓練資料足、特徵相關 | OOB 錯誤、特徵重要性、學習曲線 |
| 神經網路 | 資料足、適當架構、無資料洩漏 | 驗證曲線、過擬合檢查 |
## Assumption Check Results
| Analysis Step | Method | Assumption | Checked? | Result |
|---------------|--------|------------|----------|--------|
| Primary model | Linear regression | Normality of residuals | Yes | Q-Q plot shows mild deviation — acceptable for n>100 |
| Primary model | Linear regression | Homoscedasticity | No | Not checked — recommend adding Breusch-Pagan test |
預期: 每統計法之假設皆明檢或承認。 失敗時: 若假設違,檢作者是否處之(穩健法、轉換、敏感度分析)。
資料洩漏發生於訓練集外之資訊影響模型,致過於樂觀之效能:
## Leakage Assessment
| Check | Status | Evidence |
|-------|--------|----------|
| Target leakage | Clear | No features derived from target |
| Temporal leakage | CONCERN | Feature X uses 30-day forward average |
| Train-test contamination | Clear | StandardScaler fit on train only |
| Group leakage | CONCERN | Patient IDs not used for stratified split |
預期: 所有常見洩漏模式皆檢,附 clear/concern 狀態。 失敗時: 若見洩漏,藉重跑而無洩漏特徵(若可)以估其影響或標予分析師察。
預期: 模型驗證合用例(預測 vs. 推論)。 失敗時: 若測試集效能可疑近於訓練效能,標潛在洩漏。
## Reproducibility Checklist
| Item | Status | Notes |
|------|--------|-------|
| Code runs without errors | [Yes/No] | Tested on [environment description] |
| Random seeds set | [Yes/No] | Line [N] in [file] |
| Dependencies documented | [Yes/No] | requirements.txt / renv.lock present |
| Data loading reproducible | [Yes/No] | Path is [relative/absolute/URL] |
| Results match reported values | [Yes/No] | Verified: Table 1 ✓, Figure 2 ✗ (minor discrepancy) |
| Environment documented | [Yes/No] | Python 3.11 / R 4.5.0 specified |
預期: 可重現性藉重跑分析驗(若資料不可得則自代碼評)。 失敗時: 若結果不精確重現,定差異是否於浮點容差內或表問題。
## Data Analysis Review
### Overall Assessment
[1-2 sentences: Is the analysis sound? Does it support the conclusions?]
### Data Quality
[Summary of data quality findings, impact on results]
### Methodological Concerns
1. **[Title]**: [Description, location in code/report, suggestion]
2. ...
### Strengths
1. [What was done well]
2. ...
### Reproducibility
[Tier assessment: Gold/Silver/Bronze/Opaque with justification]
### Recommendations
- [ ] [Specific action items for the analyst]
預期: 評論提供可行之回饋,附具體之代碼位置引用。 失敗時: 若時受限,將資料品質與洩漏檢優於風格問題。
review-research — 更廣之研究方法論與稿件評審validate-statistical-output — 雙重編程驗證方法論generate-statistical-tables — 出版級統計表review-software-architecture — 代碼結構與設計評審