How to Calculate Inter Rater Reliability on Excel

Inter-Rater Reliability Calculator (Cohen's Kappa) body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; } .calculator-wrapper { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 25px; margin-bottom: 40px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); } .calc-title { text-align: center; margin-bottom: 20px; color: #2c3e50; font-size: 1.5em; font-weight: 700; } .matrix-container { display: flex; justify-content: center; margin-bottom: 20px; overflow-x: auto; } .matrix-table { border-collapse: collapse; background: white; border-radius: 4px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); } .matrix-table th, .matrix-table td { padding: 10px; text-align: center; border: 1px solid #dee2e6; } .matrix-table th { background-color: #e9ecef; font-weight: 600; font-size: 0.9em; } .matrix-table td input { width: 80px; padding: 8px; text-align: center; border: 1px solid #ced4da; border-radius: 4px; font-size: 16px; } .matrix-label { font-weight: bold; color: #495057; } .vertical-header { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; vertical-align: middle; padding: 15px 5px; } .btn-calculate { display: block; width: 100%; padding: 12px; background-color: #007bff; color: white; border: none; border-radius: 4px; font-size: 18px; cursor: pointer; transition: background 0.2s; margin-top: 15px; } .btn-calculate:hover { background-color: #0056b3; } .results-area { margin-top: 20px; background: white; padding: 20px; border-radius: 4px; border: 1px solid #dee2e6; display: none; } .result-row { display: flex; justify-content: space-between; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #eee; } .result-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; } .result-label { font-weight: 600; color: #555; } .result-value { font-weight: 700; color: #2c3e50; } .interpretation-box { margin-top: 15px; padding: 10px; background-color: #e8f5e9; color: #2e7d32; border-radius: 4px; text-align: center; font-weight: 600; } .article-content h2 { color: #2c3e50; margin-top: 30px; border-bottom: 2px solid #eee; padding-bottom: 10px; } .article-content h3 { color: #34495e; margin-top: 20px; } .article-content p, .article-content li { margin-bottom: 15px; font-size: 1.05em; } .formula-box { background: #f1f3f5; padding: 15px; border-left: 4px solid #007bff; font-family: monospace; margin: 15px 0; } table.data-table { width: 100%; border-collapse: collapse; margin: 20px 0; } table.data-table th, table.data-table td { border: 1px solid #ddd; padding: 8px; text-align: left; } table.data-table th { background-color: #f2f2f2; }
Inter-Rater Reliability Calculator (Cohen's Kappa)

Enter the counts for each scenario in the 2×2 Confusion Matrix below.
(Assumes 2 Raters and 2 Categories, e.g., Yes/No)

Rater B
Yes / Positive No / Negative
Rater A Yes / Positive
No / Negative
Total Observations (N):
Observed Agreement (Po):
Expected Agreement (Pe):
Cohen's Kappa (κ):

How to Calculate Inter-Rater Reliability

Inter-Rater Reliability (IRR) is a critical statistical measure used to assess the degree of agreement between different people (raters) assessing the same qualitative data. While percent agreement is a simple metric, it fails to account for the possibility of raters agreeing purely by chance. This is where Cohen's Kappa becomes the standard for robust analysis.

Why Use Cohen's Kappa?

Cohen's Kappa (κ) is robust because it compares the Observed Agreement ($P_o$) against the Expected Agreement ($P_e$) that would occur by random chance. A value of 1 implies perfect agreement, while a value of 0 implies agreement no better than random chance.

The Logic Behind the Calculation

To calculate Kappa manually or in Excel, you first organize your data into a confusion matrix (as seen in the calculator above). The formula is:

κ = (Po – Pe) / (1 – Pe)
  • Observed Agreement ($P_o$): The proportion of times raters actually agreed.
    Formula: (A_Yes_B_Yes + A_No_B_No) / Total
  • Expected Agreement ($P_e$): The probability that they would agree by chance, based on each rater's individual frequency of saying "Yes" or "No".

How to Calculate in Excel

While the calculator above is instant, you may need to process raw data in Excel. Here is a step-by-step method assuming you have Rater A in Column A and Rater B in Column B:

  1. Create a Pivot Table or Confusion Matrix:
    Use the COUNTIFS function to fill a 2×2 grid.
    • Cell AA (Both Yes): =COUNTIFS(A:A, "Yes", B:B, "Yes")
    • Cell AB (A Yes, B No): =COUNTIFS(A:A, "Yes", B:B, "No")
    • Cell BA (A No, B Yes): =COUNTIFS(A:A, "No", B:B, "Yes")
    • Cell BB (Both No): =COUNTIFS(A:A, "No", B:B, "No")
  2. Sum the Rows and Columns: Calculate the marginal totals for each rater.
  3. Calculate Expected Probabilities: Multiply the marginal probability of "Yes" for Rater A by the marginal probability of "Yes" for Rater B (and repeat for "No").
  4. Apply the Kappa Formula: Use the standard formula $(P_o – P_e) / (1 – P_e)$.

Interpreting Your Kappa Score

Once you have your result, use the table below (Landis and Koch scale) to understand the strength of the agreement:

Kappa Value Interpretation
< 0.00 Poor (Less than chance)
0.01 – 0.20 Slight Agreement
0.21 – 0.40 Fair Agreement
0.41 – 0.60 Moderate Agreement
0.61 – 0.80 Substantial Agreement
0.81 – 1.00 Almost Perfect Agreement
function calculateKappa() { // Get input values var aa = parseInt(document.getElementById('cellAA').value) || 0; // Both Yes var ab = parseInt(document.getElementById('cellAB').value) || 0; // A Yes, B No var ba = parseInt(document.getElementById('cellBA').value) || 0; // A No, B Yes var bb = parseInt(document.getElementById('cellBB').value) || 0; // Both No // Calculate Totals var totalN = aa + ab + ba + bb; if (totalN === 0) { alert("Please enter at least one value in the matrix."); return; } // Observed Agreement (Po) // (Agreed Yes + Agreed No) / Total var observedAgreement = (aa + bb) / totalN; // Expected Agreement (Pe) calculations // Marginal totals var totalAYes = aa + ab; var totalANo = ba + bb; var totalBYes = aa + ba; var totalBNo = ab + bb; // Probabilities var probAYes = totalAYes / totalN; var probANo = totalANo / totalN; var probBYes = totalBYes / totalN; var probBNo = totalBNo / totalN; // Probability of chance agreement for Yes and No var chanceYes = probAYes * probBYes; var chanceNo = probANo * probBNo; var expectedAgreement = chanceYes + chanceNo; // Calculate Kappa var kappa = 0; if (expectedAgreement === 1) { kappa = 1; // Perfect agreement in marginals logic usually handles edge cases, but avoid div by zero } else { kappa = (observedAgreement – expectedAgreement) / (1 – expectedAgreement); } // Display Results document.getElementById('resultArea').style.display = 'block'; document.getElementById('totalN').innerText = totalN; document.getElementById('obsAgreement').innerText = (observedAgreement * 100).toFixed(2) + "%"; document.getElementById('expAgreement').innerText = (expectedAgreement * 100).toFixed(2) + "%"; document.getElementById('kappaScore').innerText = kappa.toFixed(3); // Interpretation Logic var interpBox = document.getElementById('interpretation'); var interpText = ""; var bgColor = ""; var textColor = ""; if (kappa < 0) { interpText = "Poor Agreement (Less than chance)"; bgColor = "#ffebee"; textColor = "#c62828"; } else if (kappa <= 0.20) { interpText = "Slight Agreement"; bgColor = "#fff3e0"; textColor = "#ef6c00"; } else if (kappa <= 0.40) { interpText = "Fair Agreement"; bgColor = "#fff8e1"; textColor = "#f9a825"; } else if (kappa <= 0.60) { interpText = "Moderate Agreement"; bgColor = "#e3f2fd"; textColor = "#1565c0"; } else if (kappa <= 0.80) { interpText = "Substantial Agreement"; bgColor = "#e8f5e9"; textColor = "#2e7d32"; } else { interpText = "Almost Perfect Agreement"; bgColor = "#00695c"; textColor = "#ffffff"; } interpBox.innerText = interpText; interpBox.style.backgroundColor = bgColor; interpBox.style.color = textColor; }

Leave a Comment