The costing sheet says this recipe should land at $1.40 per kilogram. The dye floor comes back at $1.71. Nobody can say why until someone pulls the batch card, and by then the order has already been quoted.
This happens because most dyeing recipe costing still runs on a recipe book last updated two years ago, plus a costing engineer's gut feel for "dark shades cost more." That rule of thumb is not wrong, it is just too blunt to price a quote or defend a chemical budget in a review meeting.
Regression analysis to predict dyeing recipe cost fixes this without asking anyone to become a statistician. It takes the batch records you already have (shade depth, liquor ratio, GSM, dye class, actual chemical cost) and turns them into a formula that tells you, before the batch runs, what a recipe should cost and which variables are actually driving that cost.
Why Does Dyeing Recipe Cost Vary So Much Between "Similar" Batches?
Two recipes that look alike on the docket can cost 25–30% apart in practice, and the variance rarely comes from one factor alone.
Shade depth drives dye consumption non-linearly: a 3% shade does not cost three times a 1% shade, because deep shades often need extra shading additions to hit the standard, the same additions that our piece on getting reactive dyeing right the first time treats as a quality miss rather than a free pass, and each one quietly inflates the cost this model is trying to predict. Liquor ratio changes how much water (and therefore how much salt, alkali and auxiliary) the recipe carries. Fabric GSM interacts with all of the above because the weight-on-fabric percentages that define shade depth are literally a percentage of fabric weight.
A rule of thumb, "dark shades cost roughly 40% more than light ones," averages across all of this and gets any individual recipe wrong in both directions. The fix is a model that separates these variables and weights each one from your own batch history.
Field note: A mill in Vietnam was pricing all navy shades at a flat $1.65/kg chemical cost regardless of machine. When the costing team ran the actual batch records, navy on a 1:8 liquor ratio soft-flow machine was averaging $1.89/kg while the same shade on a 1:5 jet was $1.58/kg, a 20% spread the flat rate had been hiding for at least three seasons.
What Is Multiple Linear Regression, in Terms That Matter Here?
Multiple linear regression fits a straight-line relationship between one outcome you want to predict (recipe cost per kilogram) and several inputs you already record for every batch:
Predicted cost = intercept + (b1 × shade depth) + (b2 × liquor ratio) + (b3 × GSM) + (b4 × dye class)Each b is a coefficient the regression calculates from your historical batches: how much predicted cost moves when that one variable moves by one unit, holding the others constant. A spreadsheet's built-in regression tool (Data Analysis add-in in Excel, or LINEST) fits them from a table of past batches in seconds, often the first real capability in what our guide to building a manufacturing analytics stack argues a mid-sized factory should build before anything more elaborate.
Dye class needs to enter the model as a dummy variable, because "reactive," "disperse," and "vat" are categories, not numbers. Pick one class as the reference and create a 0/1 column for each other class you dye.
How Do You Read the Regression Output Without Drowning in Theory?
A regression printout throws a wall of numbers at you. Three decide whether the model is usable.
Output | What it tells you | What to check |
|---|---|---|
Adjusted R-squared | Share of cost variation the model explains | Above 0.75 is usable for costing; below 0.5, a real driver is missing |
Coefficient sign and size | Direction and magnitude of each variable's effect, holding others fixed | A sign that contradicts floor knowledge means a data error, not a discovery |
p-value | Whether an effect is likely real or noise from a small sample | Above roughly 0.05, treat the variable as "not proven yet" |
Adjusted R-squared matters more than plain R-squared once you have four or five predictors, because plain R-squared always rises when you add another variable even if that variable is useless. Once the model is live, watching how far actual cost drifts from predicted cost batch to batch is really a control-charting problem, and our practical guide to statistical process control covers setting those limits.
Worked Example: Nine Batches, One Costing Formula
Take nine completed batches from a reactive dyeing floor, each with actual chemical cost per kilogram already known from store issue records.
Batch | Shade depth (% owf) | Liquor ratio | GSM | Dye class | Actual cost ($/kg) |
|---|---|---|---|---|---|
1 | 0.8 | 1:6 | 160 | 0 | 1.22 |
2 | 1.5 | 1:6 | 180 | 0 | 1.41 |
3 | 2.2 | 1:8 | 200 | 0 | 1.68 |
4 | 0.5 | 1:5 | 140 | 0 | 1.08 |
5 | 3.0 | 1:8 | 220 | 0 | 1.94 |
6 | 1.0 | 1:10 | 160 | 1 | 1.55 |
7 | 2.5 | 1:6 | 200 | 0 | 1.79 |
8 | 1.8 | 1:10 | 180 | 1 | 1.98 |
9 | 0.3 | 1:5 | 140 | 0 | 0.97 |
Running these nine rows through a spreadsheet regression against actual cost produces the following fitted model.
Term | Coefficient | p-value |
|---|---|---|
Intercept | 0.41 | 0.03 |
Shade depth (% owf) | 0.29 | 0.001 |
Liquor ratio (per unit) | 0.06 | 0.02 |
Fabric GSM (per 10 units) | 0.03 | 0.09 |
Dye class: disperse (vs reactive) | 0.21 | 0.04 |
The model returns an adjusted R-squared of 0.94. Shade depth and liquor ratio are the two variables actually earning their place, at p-values of 0.001 and 0.02; GSM sits at 0.09, worth watching rather than leaning on yet with only nine batches behind it.
Take a new recipe due to run next week: 2.0% shade depth, liquor ratio of 7, GSM of 190, reactive dye class. Plugging those into the fitted equation:
Predicted cost = 0.41 + (0.29 × 2.0) + (0.06 × 7) + (0.03 × 19) + (0.21 × 0)
= 0.41 + 0.58 + 0.42 + 0.57
= $1.98/kgThat number goes on the quote sheet instead of a flat rate card, and it comes with a defensible reason attached to every dollar of it.
Guardrails Before You Trust a Coefficient
If every disperse batch also ran on the same high-liquor-ratio machine, the model cannot separate dye class from machine effect: the coefficients stay unreliable until the pattern breaks.
Watch for GSM and liquor ratio moving together: if removing one variable swings the other's coefficient by more than 20–30%, they are fighting each other for credit.
One re-dye or dosing-error batch skews a nine-point dataset hard: pull known-abnormal batches out before fitting, or refit both ways to see how much they move.
Only trust a prediction that falls inside the minimum and maximum of every predictor in your training set. Outside that range, treat the number as a rough anchor, not a quote.
Regression Costing Readiness Checklist
Question | If yes | If no |
|---|---|---|
20+ completed batches with actual chemical cost recorded? | Enough to fit a first model | Start logging cost per batch first |
Shade depth, liquor ratio, GSM and dye class all captured per batch? | Model has its core predictors | Add the missing field to the batch card |
Adjusted R-squared above 0.75 on your fitted model? | Usable for costing decisions | Look for a missing driver: machine type, additive count |
Every predictor's p-value checked before trusting its coefficient? | You know which variables to lean on | You risk pricing on noise |
New recipe's inputs fall inside the training data's range? | Trust the prediction | Treat it as a rough anchor, verify manually |
Known bad batches excluded or flagged? | Coefficients reflect normal production | One outlier is quietly distorting your formula |
Model refitted as new batches accumulate? | Coefficients stay current with today's costs | You are pricing on last year's cost structure |
Final Word
A dyeing recipe cost model does not need to be sophisticated to beat a flat rate card: it needs the four or five variables that actually move cost, entered honestly from batch records that already exist. The regression is not replacing the costing engineer's judgment; it is giving that judgment a number that survives a client pushing back on a quote. Start with the batches you have, check the p-values before you trust a coefficient, and refit every season as chemical prices move. The same discipline pays off upstream of costing too: feeding cleaner volume forecasts into the recipe plan is what our guide to exponential smoothing for demand planning is built to do.




Discussion0
Loading the discussion…