SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

[JASP Practice & Operation] "Stress cannot be measured, but I want to know the cause" — A comeback story of breaking through a dead-end defective product problem using statistics (Discriminant Analysis & Logistic Regression)

▶️ Introduction: Why are "Discriminant Analysis & Logistic Regression" necessary?


In the previous [Story Edition], we introduced a story about solving a part cracking problem caused by "stress," which cannot be measured directly, using a statistical approach based on available design parameters and "good/defective" result data.

This time, we follow up with the [Operation Edition].
Using the free statistical software "JASP," we will explain step-by-step how to actually visualize the "boundary line between good and defective products" and identify the true causes (important parameters).

In manufacturing and R&D, it is not uncommon to hit a wall where "the result is known, but the cause of the separation cannot be measured directly."
In such cases, before giving up, I would like you to try the"2-stage approach (visual exploration + quantification)"that maximizes the strengths of JASP. I will reveal highly practical techniques that can be used on the shop floor while avoiding errors specific to certain modules.


🚧 Chapter 1: Data Preparation and JASP "Etiquette"


First, let's load the data from the field into JASP.
The data to prepare consists of a total of 5 columns: "4 design parameters ($${X_1, X_2, X_3, X_4}$$)" for 35 prototypes, and the "Judgment (Good / No good)" result from durability tests.


Dataset

💡 Practical Tip: Checking Data Types
Once loaded, check the icon for the judgment column (let's call it `Judgment` here). If it is a ruler icon (scale), you cannot perform classification analysis. Click the icon and change it to the "Nominal" scale, represented by three balls.


👁️ Chapter 2: [Visual Exploration] Visualizing the "Boundary Line" with Linear Discriminant Analysis


Instead of diving straight into formulas, let's first look at the data graphically to get a visual hunch of "which parameters are suspicious."
Here, we use the JASP"Machine Learning"module.

  1. In the top menu, select `Machine Learning` > `Classification` > `Linear Discriminant Analysis`.

  2. TargetSet `Judgment` as the target.

  3. Add all $${X_1, X_2, X_3, X_4}$$ to **Predictors**.

  4. Expand the "Plots" menu at the bottom right and check "Decision Boundary Matrix".

Linear Discriminant Analysis settings screen and Decision Boundary Matrix plot

A colorful scatter plot will appear on the right. In the charts involving $${X_1}$$ or $${X_4}$$, good and defective products are mixed, butonly in the chart for "$${X_2}$$ and $${X_3}$$" are the two groups clearly separated by a boundary line. With this, we have a strong hunch that "the factors are $${X_2}$$ and $${X_3}$$".

⚠️ The "5% Trick" to avoid JASP errors
Because the machine learning module is designed to create strict predictive models, it has a quirk where if you try to analyze using 100% of your data, it will stop and throw an error saying "No test data!"
To avoid this, go to the settings under "Data Split Settings" > "Holdout Test Data" and set the sample to "5%". This will allow JASP to run without errors and generate beautiful plots.


🎯 Chapter 3: [Quantification] Proving the Root Cause with Logistic Regression


Now that we have a lead, let's use "Logistic Regression", which doesn't have the same error concerns, to firmly formulate (quantify) the results.

  1. Select "Regression" > "Logistic Regression" from the top menu.

  2. Put "Judgment" into the Dependent Variable.

  3. Put all of $${X_1, X_2, X_3, X_4}$$ into the Covariates.

This is where the important technique comes in.
Since calculating with all four variables as is would be inefficient, change the "Method" in the settings panel from "Enter" to "Stepwise".

Logistic regression settings (Stepwise) and the resulting coefficient table

JASP automatically discards the less influential $${X_1}$$ and $${X_4}$$, and beautifully, only $${X_2}$$ and $${X_3}$$ remain in the result table (Model 2). This is the moment when the visual intuition from the previous plot is proven to be statistically correct.


🔧 Chapter 4: Professional Finishing — Adjusting Signs and Checking Accuracy


Finally, we will perform some "finishing touches" to make the output values easier to interpret.

① Align the signs (Change reference level)
By default, it calculates the "probability of becoming a defective product (No good)," which can result in the plus/minus signs of the coefficients being the opposite of what you expect.
To fix this, click "Judgment" in the "Dependent Variable" box at the top of the settings screen, and change the "Reference Level" that appears below to "No good". This will switch the calculation to the "probability of becoming a good product."

② Compare using standardized coefficients
Check "Standardized coefficients" under "Statistics" in the settings panel. This will normalize the units of the variables, allowing for a fair comparison of their influence.

③ Prove 100% accuracy
Also under "Statistics" > Performance Diagnostics, check "Confusion Matrix".

Confusion Matrix result table

Looking at the table in the results panel, the predictions for good and defective products match reality perfectly, proving that misclassification is "0"—in other words, [100% accuracy].

I have attached the file with this analysis result. Please use it as a reference.


🏁 Conclusion: Don't be swayed by tools, master them


How was it?
This time, we intentionally used two functions across the board: "Machine Learning Module Plots" and "Logistic Regression Quantification."

Instead of struggling with errors by fixating on a single function,"grasping it visually with graphs and obtaining accurate numerical values with a different module"is the greatest trick to mastering modern data analysis tools in the field.

If you have a challenge in your own workplace where you "only know the result, but want to know the cause!", please try these JASP techniques.


📗 References


※ This article contains Amazon Associate links.


(1) Masamori Inohara (Author): Combined Use of QC Methods for Problem Solving, JUSE Press, 2016

(2) Yuna Shimizu (Author), Hikaru Yamamoto (Author): Introduction to Statistical Analysis with JASP: For Psychology, Education, Nursing, and Social Sciences (KS Specialized Books), Kodansha, 2022

(3) Yuna Shimizu (Author), Hikaru Yamamoto (Author): Multivariate Analysis with JASP Useful for Research - From Factor Analysis to Structural Equation Modeling -, Corona Publishing, 2021


🎁 Bonus


A video version of this article can be viewed at the link below. Please feel free to watch it.



いいなと思ったら応援しよう!