stat-fit-linear-model
Skill4 starsChanged 12 days agoMITView on GitHub
Fit a linear regression model, report coefficients and model fit, and generate residual diagnostic plots.
In this repository56 other files it gives its agents.
- bioinformatics-env-setupSkill
- design-thermostable-mutationsSkill
- download-gdcSkill
- download-geoSkill
- download-sraSkill
- source-summarizerSkill
- genome-alignment-qcSkill
- genome-read-alignmentSkill
- genome-variant-annotationSkill
- genome-variant-callingSkill
- genome-variant-filteringSkill
- metagenome-assemblySkill
- metagenome-binningSkill
- metagenome-functional-profilingSkill
- metagenome-host-removalSkill
- metagenome-taxonomic-profilingSkill
- ncbi-eutilities-assistantSkill
- ngs-quality-controlSkill
- ngs-read-preprocessingSkill
- paper-to-briefSkill
- predict-protein-heat-stabilitySkill
- researchSkill
- rnaseq-alignment-qcSkill
- rnaseq-differential-expressionSkill
- rnaseq-functional-enrichmentSkill
- rnaseq-read-alignmentSkill
- rnaseq-read-countingSkill
- rnaseq-transcript-quantificationSkill
- rpsblast-assistantSkill
- scrnaseq-cellranger-countSkill
- scrnaseq-cell-type-annotationSkill
- scrnaseq-clusteringSkill
- scrnaseq-differential-expressionSkill
- scrnaseq-integrationSkill
- scrnaseq-quality-controlSkill
- scrnaseq-trajectory-analysisSkill
- search-enaSkill
- search-geoSkill
- search-gsaSkill
- search-ncbi-datasetsSkill
- search-sraSkill
- stat-analyze-distributionSkill
- stat-assess-data-qualitySkill
- stat-bayesian-estimationSkill
- stat-cluster-samplesSkill
- stat-compare-multiple-groupsSkill
- stat-compare-two-groupsSkill
- stat-fit-glmSkill
- stat-learn-bayesian-networkSkill
- stat-logistic-regressionSkill
- stat-nonlinear-embeddingSkill
- stat-pairwise-correlationSkill
- stat-pcaSkill
- stat-survival-analysisSkill
- structured-intelligence-skill-creatorSkill
- <skill-id>Skill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use cases include: gene expression vs.
- Distinctive: line 28
Read data; validate that response and predictor columns exist and are appropriate types.
- Distinctive: line 34
Test regression assumptions: normality of residuals (Shapiro-Wilk), homoscedasticity (Breusch-Pagan), absence of influential points (Cook's …
- Distinctive: line 35
Write results table (TSV), model summary (text), and diagnostic plots (PDF) to output directory.
- Distinctive: line 49
Does not handle multicollinearity automatically.
- Very specific: line 50
Not suitable for count data, binary outcomes, or data with heavy censoring — use stat-fit-glm instead.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: Linear Regression Modeling
Use When
- User wants to model the linear relationship between a continuous outcome and one or more predictors
- User needs coefficient estimates, confidence intervals, and p-values for each predictor
- User wants to assess model fit (R², adjusted R²) and check regression assumptions
- Use cases include: gene expression vs. age, protein concentration vs. metabolic rate, any dose-response relationship
Inputs
- Required:
- Data table (CSV or TSV) with a numeric response variable and one or more numeric or categorical predictor columns
- Response (outcome) variable name
- Predictor variable name(s)
- Optional:
- Interaction terms (e.g.,
var1:var2) - Standardize predictors:
trueorfalse(default:false) - Output directory (default:
./lm_output)
- Interaction terms (e.g.,
Workflow
- Read data; validate that response and predictor columns exist and are appropriate types.
- Encode categorical predictors as dummy variables (reference level = first alphabetical level).
- Fit the linear model:
response ~ predictorsusing ordinary least squares. - Report for each coefficient: estimate, standard error, t-statistic, p-value, 95% confidence interval.
- Report model fit: R², adjusted R², F-statistic, overall p-value, AIC, BIC.
- Generate residual diagnostic plots: (a) residuals vs. fitted, (b) Q-Q plot of residuals, (c) scale-location, (d) Cook's distance.
- Test regression assumptions: normality of residuals (Shapiro-Wilk), homoscedasticity (Breusch-Pagan), absence of influential points (Cook's distance > 4/n).
- Write results table (TSV), model summary (text), and diagnostic plots (PDF) to output directory.
- Save the executable analysis script (
analysis_code.pyoranalysis_code.R) and software version manifest (session_info.txt) used to produce results.
Output Contract
- Coefficient table (TSV): term, estimate, std_error, t_statistic, p_value, ci_lower, ci_upper
- Model fit summary (TSV): r_squared, adj_r_squared, f_statistic, f_p_value, aic, bic, n
- Residual diagnostic plots (PDF, 4-panel)
- Assumption test results (printed to stdout)
- Reproducibility artifacts:
analysis_code.pyoranalysis_code.R, plussession_info.txt
Limits
- Assumes linearity, independence, homoscedasticity, and normality of residuals — check diagnostic plots.
- Does not handle multicollinearity automatically; check VIF (variance inflation factor) separately if many predictors.
- Not suitable for count data, binary outcomes, or data with heavy censoring — use
stat-fit-glminstead. - Common failure: near-perfect multicollinearity among predictors causes singular matrix error.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

