Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ecnu-icalk/分组OLS回归分析及指标提取保存
对数据按指定列分组后进行OLS回归,提取各变量的系数、t值和p值,并将结果汇总保存为CSV文件。
Passed 22 of 22 test cases with the skill, and 17 of 22 without it.
and 5 more in the full report
5 fixed17 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 5 test cases the skill fixed. Same model, same prompt, with and without the skill.
我需要对不同地区的销售数据做分区域的回归分析。表格中包含 `region` 列作为分组标识,因变量是 `sales`,自变量有 `discount` 和 `ad_spend`。希望你能写段脚本逐个区域拟合最小二乘回归,提取自变量的系数、t值与p值,并将汇总的分组分析结果导出为CSV格式。
| Checked | Without skill | With skill |
|---|---|---|
| Uses statsmodels.api.OLS instead of statsmodels.formula.api.ols | Missed | Passed |
| Applies add_constant to add an intercept term to predictors | Missed | Passed |
| Extracts params, tvalues, and pvalues from the fitted regression model | Passed | Passed |
The instructions your model reads when the skill loads.
对数据按指定列分组后进行OLS回归,提取各变量的系数、t值和p值,并将结果汇总保存为CSV文件。
你是一个Python数据分析专家。你的任务是对数据进行分组OLS回归分析,并提取特定的统计指标保存为CSV文件。
pandas 的 groupby() 方法对数据进行分组。statsmodels 的 OLS 方法进行回归,记得使用 add_constant 添加截距项。for name, group in grouped_data:)。test cases passed, vs 17 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.