AI summary by TwinMind
R-squared, Clearly Explained!!!
StatQuest with Josh Starmer
11m 1s
Introduction to R-Squared
- R-squared is correlation metric - easy to compute, intuitive to interpret
- Most familiar with plain old R correlation
- R values close to 1 or -1 = good (strong relationship between quantitative variables like weight/size)
- R values close to 0 = weak correlation
Why R-Squared vs Plain R
- R-squared interpretation easier than regular R
- Example: R = 0.7 not obviously twice as good as R = 0.5
- But R² = 0.49 vs R² = 0.25 shows clear 1.4x improvement
- R-squared easy and intuitive to calculate
Basic Calculation Example - Mouse Weight Data
- Plot: mouse weight (Y-axis) vs mouse ID numbers 1-7 (X-axis)
- Calculate mean/average mouse weight as horizontal line across graph
- Variation around mean = sum of squared differences from each data point to mean
- Reorder mice by size instead of ID number on X-axis
- Mean and variation remain exactly same - just reordered data
Fitting Line vs Using Mean
- Question: Is mean weight best predictor for individual mouse weight given size?
- Answer: No - can do better by fitting line through data
- Blue line allows weight prediction based on mouse size
- Visual assessment: blue line fits data better than mean
R-Squared Formula and Calculation
- R² = (Variation around mean - Variation around line) / Variation around mean
- Numerator = difference between variations
- Denominator = variation around mean
- Makes R² range 0 to 1 (variation around line never > variation around mean, never < 0)
- Division makes R² a percentage
Worked Example - Size vs Weight
- Variation around mean = 32
- Variation around blue line = 6
- R² = (32 - 6) / 32 = 26/32 = 0.81 = 81%
- Interpretation: 81% less variation around line than mean
- Size-weight relationship accounts for 81% of total variation
- Most variation in data explained by size-weight relationship
Poor Correlation Example - Weight vs Rock Sniffing
- Y-axis: mouse weight, X-axis: time spent sniffing rock
- Variation around mean = 32 (same as before)
- Variation around blue line = 30 (much larger)
- R² = (32 - 30) / 32 = 2/32 = 0.06 = 6%
- Only 6% less variation around line than mean
- Sniff-weight relationship accounts for only 6% of total variation
- Hardly any variation explained by sniff-weight relationship
Interpreting R-Squared Values
- R² = 0.9: "Very good" - relationship explains 90% of variation
- R² = 0.01: "Who cares" - only 1% of variation explained, something else explains remaining 99%
Relationship Between R and R-Squared
- R-squared = R²
- Plain R = 0.9 → R² = 0.9 × 0.9 = 0.81 (81% variation explained)
- Plain R = 0.5 → R² = 0.5 × 0.5 = 0.25 (25% variation explained)
Comparison Advantage of R-Squared
- R-squared easier to interpret than plain R
- Example: How much better is R = 0.7 than R = 0.5?
- R = 0.7 → R² = 0.49 (49% variation explained)
- R = 0.5 → R² = 0.25 (25% variation explained)
- Clear that first correlation twice as good (49% vs 25%)
Limitations of R-Squared
- R-squared doesn't indicate direction of correlation (squared numbers never negative)
- If direction not obvious, specify "positively or negatively correlated with R² = [value]"
Key Takeaways
- R-squared = percentage of variation explained by relationship between two variables
- Given plain R value, square it mentally for better understanding
- Two main concepts: variation explanation percentage and R-to-R² conversion
