Calculator
Example Data Table
These rows show example confusion matrix inputs and sample output behavior.
| Scenario | TP | TN | FP | FN | MCC | Fisher z |
|---|---|---|---|---|---|---|
| Strong classification | 42 | 50 | 8 | 10 | 0.6715 | 0.8136 |
| Moderate classification | 30 | 60 | 20 | 15 | 0.4082 | 0.4335 |
| Weak classification | 15 | 18 | 12 | 14 | 0.1176 | 0.1182 |
What This Calculator Measures
The z-score Matthews correlation coefficient calculator helps you evaluate binary classification quality with more depth. It uses confusion matrix counts. These are true positives, true negatives, false positives, and false negatives. From these values, the tool computes MCC. MCC is a balanced performance metric. It works well when classes are uneven. It also helps when accuracy looks strong but errors are hidden.
Why MCC Matters in Statistics
Many metrics ignore part of the confusion matrix. MCC uses every core outcome. That makes it useful for imbalanced datasets, screening tests, fraud models, and quality control tasks. A value near 1 shows strong agreement. A value near 0 shows weak association. A value near -1 shows inverse prediction behavior. This page also adds Fisher z output, a z-statistic, confidence intervals, and a p-value. These features support stronger statistical interpretation.
Formula Used
The Matthews correlation coefficient formula is: MCC = ((TP × TN) − (FP × FN)) / √((TP + FP)(TP + FN)(TN + FP)(TN + FN)). The calculator then applies Fisher’s z transform: z′ = 0.5 × ln((1 + MCC) / (1 − MCC)). The standard error is 1 / √(n − 3), where n is the total sample size. The test statistic compares the transformed value with the selected null MCC. Confidence limits are converted back to the MCC scale.
How to Use This Calculator
Enter the four confusion matrix counts first. Choose a confidence level. Keep the null MCC at 0 for a standard significance test, or enter another benchmark. Pick the decimal display you prefer. Submit the form. The result box appears above the calculator. Review MCC, Fisher z, z-statistic, p-value, confidence interval, and supporting metrics. Then export the result as CSV or PDF for reporting.
How to Read the Result
Use MCC as the main quality score. Use the z-statistic and p-value to test whether the observed association differs from the null value. Use the interval to judge precision. Narrow intervals suggest more stable evidence. Wide intervals suggest caution. This combined view is helpful for research, analytics, model review, and validation reporting. It gives a clearer picture than accuracy alone. That matters when positive cases are rare, expensive, or operationally important. It supports careful decisions.
Frequently Asked Questions
1. What does MCC measure?
MCC measures agreement between observed and predicted binary outcomes. It uses all four confusion matrix cells. That makes it more balanced than accuracy alone, especially when one class is much larger.
2. Why add a z-score to MCC?
The z-based section helps test whether the observed MCC differs from a chosen null value. It adds significance testing and interval estimation, not just a single performance score.
3. Is this useful for imbalanced data?
Yes. MCC is widely used when class sizes are uneven. It penalizes both false positives and false negatives while still using true positives and true negatives.
4. What happens if the denominator becomes zero?
Some confusion matrices make MCC undefined. This usually happens when predictions or actual labels collapse into one side. The calculator explains this case and reports notes when a limiting value is used.
5. Is high accuracy enough?
Not always. Accuracy can look strong even when a model fails on the minority class. MCC gives a more balanced view of binary classification quality.
6. What does a negative MCC mean?
A negative MCC means the prediction pattern is moving against the actual labels. Strongly negative values suggest systematic inverse classification behavior.
7. Why might p-value or interval output be unavailable?
These values require enough total observations and a usable MCC estimate. Very small samples or undefined MCC cases can block Fisher z, interval, and z-statistic calculations.
8. What does the confidence interval tell me?
The interval shows a plausible range for the underlying MCC. Narrow intervals suggest more stable evidence. Wider intervals suggest more uncertainty in model quality.