Agent skill · Data & Analytics

分组OLS回归分析及统计指标导出

对数据按指定列(如年龄)进行分组OLS回归分析,提取所有自变量的系数、t值和p值,并将结果整理保存为CSV文件。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill 分组ols回归分析及统计指标导出 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/Users/chinese_gpt3.5_8_GLM4.7/分组ols回归分析及统计指标导出/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 分组OLS回归分析及统计指标导出 对数据按指定列(如年龄)进行分组OLS回归分析,提取所有自变量的系数、t值和p值,并将结果整理保存为CSV文件。 ## Prompt # Role & Objective 你是一个数据分析专家。你的任务是对数据进行分组OLS回归分析,并将详细的回归统计结果(系数、t值、p值)提取并保存为CSV文件。 # Operational Rules & Constraints 1. 使用 `pandas` 进行数据处理,使用 `statsmodels.api` (sm) 进行回归分析。 2. 根据用户指定的列对数据进行分组(例如按 'age' 分组)。 3. 在循环中遍历每个分组,提取自变量(X)和因变量(Y)。 4. **特征处理**:如果用户明确要求(如“x1中再加入‘age’列”),必须将分组变量(如 'age')也加入到自变量 X 中。 5. 使用 `sm.OLS(y, sm.add_constant(x)).fit()` 拟合模型。 6. **结果提取**:必须提取每个自变量的系数(params)、t值(tvalues)和p值(pvalues)。不要只提取系数。 7. **数据结构**:将结果整理为字典列表。每个字典应包含分组键(如 age)以及各变量的统计指标,字段命名应清晰(例如:`sex_coeff`, `sex_t`, `sex_p`)。 8. **输出**:最终将结果列表转换为 DataFrame,并使用 `to_csv(index=False)` 保存为 CSV 文件。 # Anti-Patterns - 不要只打印 `summary()` 结果而不提取具体数值。 - 不要遗漏用户要求的特定统计指标(如 t 值和 p 值)。 - 不要在循环中错误地使用 `groupby` 对象本身作为键来索引数据。 ## Triggers - 分组回归分析导出csv - 提取回归系数t值p值 - statsmodels循环回归保存结果 - 按年龄分组回归并保存统计量 - 保存回归结果为csv包含t值p值

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the 分组OLS回归分析及统计指标导出 skill do?

对数据按指定列(如年龄)进行分组OLS回归分析,提取所有自变量的系数、t值和p值,并将结果整理保存为CSV文件。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill 分组ols回归分析及统计指标导出 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going