GAMI

Causal Analysis Sandbox

Identification of the root causes of scrap in production

← All demos

Purpose

Distinguishing true causes of scrap from mere correlations. The data is simulated with known causes, so every result can be verified.

Background

Based on the Causal Analysis project for an injection moulding machine (station M05) and an assembly line (stations M01–M08). Production data is replaced by a simulation with defined causes and confounders.

Procedure

  1. Configure the parameters on the left or keep the defaults.
  2. Work through tabs 1 to 5. Each tab represents one analysis step.
  3. Enable "Reveal solution" to compare the results with the true effects.
1

Data

Parts produced and scrap rate

2

Correlation

Identification of suspicious parameters

3

Threshold rules

Critical limit per parameter

4

Causal analysis

Verification of the causal effect

5

Traceability

Station at which scrap is detected

Suggested experiments
  • Correlation vs. causation: The check pin width (M04) has no effect but correlates with scrap via the material batch. Compare tabs 2 and 4.
  • Without confounders: Set the strength of confounders to 0. Simple and adjusted estimates converge.
  • Omitted variable: Deselect "Material batch" in tab 4. The adjusted estimate becomes biased.
  • Symptom vs. cause: The leak test (M07) shows the strongest correlation but is measured after the defect occurs.
  • Deactivated cause: Set "Injection pressure too high" to 0. The estimated effect approaches zero.
Reference to the original notebooks
  • 1 Data: 00_Process_Input_Data, 01_Database_Analysis
  • 2 Correlation: 02_1, 03_1, R_2.2
  • 3 Threshold rules: 02_2_injection_molding_rules
  • 4 Causal analysis: 04_Causal_analysis, R_2.4
  • 5 Traceability: Scrap_Sigments

Step 1: Overview of the parts produced and the resulting scrap.

Scrap rate per mould cavity (nest)

Scrap rate per nest. Dashed line: overall average.

Interpretation

A nest significantly above average indicates a defective cavity. Controlled by the parameter "Defect in nest 3".

Scrap rate by hour of day

Scrap rate per hour. Dashed line: overall average.

Interpretation

Fluctuations over the day are caused by temperature, a confounder that affects process parameters and scrap simultaneously.

Raw data (first 10 of parts)

Step 2: Identification of suspicious parameters. A correlation indicates a possible cause but does not prove it.

Correlation of each parameter with scrap

Positive: higher values coincide with more scrap. Negative: with less scrap. Bar length indicates strength.

Method

Spearman rank correlation, calculated per parameter. A strong correlation can also result from a confounder that affects both the parameter and scrap.

Importance in a combined model

Contribution of each parameter to the prediction of scrap when all parameters are considered jointly.

Method

Logistic regression across all parameters; bar length equals the magnitude of the standardised coefficient. The original notebooks use Random Forest and SHAP.

Grey bar: leak test (M07). Measured after the defect occurs; therefore a symptom, not a cause, and excluded from step 4.

Step 3: Definition of a threshold rule, e.g. injection pressure above 1,500 bar.

Adjust

Distribution of OK and scrap parts

Blue: OK parts. Orange: scrap parts. Black line: selected threshold. Scrap concentrated beyond the line indicates an effective rule.

Definition of lift

Lift = scrap rate beyond the threshold ÷ overall scrap rate. Rules are considered relevant from a lift of 1.1. "Find best threshold" selects the threshold with the highest lift that still covers a sufficient number of parts.

Automatically identified rules

Best threshold per parameter. Select a row to apply it.

Step 4: Verification of whether a rule causes scrap after adjusting for confounders.

Adjust
Adjust for
Method settings (advanced)

Trimming excludes parts without a comparable counterpart. Clipping limits extreme weights. The caliper defines the maximum distance for matched pairs. The bootstrap provides a 95% confidence interval.

Estimated effect on scrap probability

Each point is one estimate in percentage points. Grey: unadjusted comparison. Blue and green: adjusted for confounders.

Methods
  • Simple comparison: difference in scrap rate between parts with and without the rule, unadjusted.
  • Corrected effect (IPW): parts are weighted so that both groups share the same distribution of confounders.
  • Effect on affected parts: same method, restricted to parts that meet the rule.
  • Matched comparison (PSM): each affected part is compared with the most similar unaffected part.

Check 1: Overlap of the groups

Orange: parts meeting the rule. Blue: other parts. Parts outside the dashed lines are excluded.

Propensity score

x-axis: probability, estimated from the confounders, that a part meets the rule. A valid comparison requires overlap between both groups.

Check 2: Balance of confounders

One row per confounder. Circle: difference before adjustment. Points: after adjustment. Values below the dashed line indicate balance.

Standardised mean difference

The SMD quantifies the difference between the groups for one confounder. Values below 0.1 indicate comparable groups and a reliable estimate.

Comparison of all rules

Results for all automatically identified rules. Select a row for a detailed analysis.

Step 5: Station at which the scrap caused by each rule is detected.

Detecting station per rule

One bar per rule. Colours indicate the detecting station.

Relevance

Defects caused at the injection moulding machine (M05) are often only detected downstream, e.g. at the leak test (M07). Late detection increases the value added to defective parts.

Table view