Install
$ agentstack add skill-jskherman-engg-skills-censored-regression ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Censored Regression (Censored Normal / Censored Lognormal)
Overview
Many process lab measurements (H2S, COS, mercaptans, DMS, disulfides, unknown sulfur, trace metals) are reported as below-LOD, below-LOQ, above an instrument range, or within an interval. Ordinary least squares on log(S + epsilon) is biased and understates uncertainty; the correct treatment is a likelihood-based censored regression.
This skill provides:
- A censored-normal regression on the log scale by default (censored lognormal
on the original response scale).
- A censored-normal regression on the raw scale with
--no-log. - Left, right, and interval censoring.
- Maximum-likelihood fitting through SciPy.
The implementation uses a hand-rolled SciPy likelihood. It does not calculate standard errors, robust covariance estimates, or the naive substitution fit. Use bootstrap/profile-likelihood checks externally when inference quality matters.
Prerequisites
uvavailable.- The script declares
numpy,scipy, andpandasin its PEP-723 header. - On first use, writes
LICENSE_NOTIFICATION.txt.
When to Use
- Lab data has below-LOQ rows that you cannot drop without introducing
selection bias.
- Reported values include intervals, for example between LOD and LOQ.
- Fitting a regression of
log(species)on operating variables, where the
species is sometimes censored.
Don't use for
- Fully uncensored regression: use
engineering-statistics. - Time-to-event survival analysis: use a survival-analysis package.
- Compositional response data (sulfur speciation fractions): combine with
compositional-data-analysis.
Utility Scripts
uv run scripts/censored.py fit --data data.csv --response S_total --predictors temperature,c5_c6plus_balance --lower-col LOQ --output /tmp/fit.jsonuv run scripts/censored.py interval --data data.csv --response S_total --predictors temperature --lower-col LOD --upper-col LOQ --output /tmp/int.json
Input CSV layout:
- One row per observation.
responsecolumn with the measured value when fully observed; NaN or blank
when censored.
lower-coland/orupper-colcolumns with the censoring bound for censored
rows.
- Predictor columns referenced by name in
--predictors.
Censoring-column semantics used by the script:
- finite
response: exact observation; bounds ignored. - missing
response+ onlylower-colfinite: left-censored, meaning
y = upper_col (above-range row).
- missing
response+ both bounds finite: interval-censored, meaning
`lower_col 80%), report only the censoring fraction and rank/order conclusions; full regression coefficients are unstable.
- If the row order is a time series, use block bootstrap or a dynamic model for
uncertainty rather than i.i.d. inference.
Verification
- Run the listed script with representative inputs and an
--outputfile when a deterministic calculation is available. - Confirm the JSON result contains
ok: true, expected units, and no unhandled warnings. - Check result magnitudes against the stated assumptions, references, and a hand calculation or known operating range before reporting them.
References
references/censored_likelihood.md— likelihood derivation.- Greene, Econometric Analysis, chapter on truncated/censored models.
- Helsel, Statistics for Censored Environmental Data Using MINITAB and R.
Anti-Patterns
- Hiding the censoring fraction in the report.
- Reporting a censored-lognormal coefficient as if it were on the original
response scale; by default, the response model is on log scale.
- Using ordinary bootstrap on autocorrelated censored data without preserving
time dependence.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: jskherman
- Source: jskherman/engg-skills
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.