Hours studied vs score (default)
- x values
- 1, 2, 2, 3, 4, 5, 5, 6, 7, 8
- y values
- 52, 55, 61, 58, 66, 70, 68, 75, 79, 84
- Coefficient
- Pearson r
- Correlation coefficient
- 0.981638
- Coefficient of determination r²
- 0.963613
- t statistic
- 14.555426
- Degrees of freedom
- 8
- p-value (two-sided)
- 4.865 × 10⁻⁷
- Strength
- Strong positive
Checked against: Python fractions for Sxx, Syy, Sxy with a decimal square root; p from the closed-form Student t CDF for integer df (Abramowitz & Stegun 26.7.4)
Negative association
- x values
- 10, 20, 30, 40, 50, 60
- y values
- 8.1, 7.4, 7.9, 6.2, 5.8, 6.0
- Coefficient
- Pearson r
- Correlation coefficient
- -0.891042
- t statistic
- -3.925982
- p-value (two-sided)
- 0.017161
- Strength
- Strong negative
Checked against: Python fractions with decimal square roots; p = 2·(1 − F_t(|t|; 4)) from the A&S 26.7.4 closed form
Spearman with tied ranks
- x values
- 1, 2, 2, 3, 4, 5, 5, 6
- y values
- 3, 1, 4, 4, 5, 9, 2, 6
- Coefficient
- Spearman ρ
- Correlation coefficient
- 0.575768
- t statistic
- 1.724946
- p-value (two-sided)
- 0.135297
- Degrees of freedom
- 6
- Strength
- Strong positive
Checked against: Python: ties averaged by hand (x ranks 1, 2.5, 2.5, 4, 5, 6.5, 6.5, 8), Pearson r of the ranks with fractions (Sxy = 95/4, Sxx = 41, Syy = 83/2), p from the A&S 26.7.4 t CDF
Perfect straight line
- x values
- 1, 2, 3, 4
- y values
- 3, 5, 7, 9
- Coefficient
- Pearson r
- Correlation coefficient
- 1
- Coefficient of determination r²
- 1
- p-value (two-sided)
- 0
- Strength
- Strong positive
Checked against: y = 2x + 1 exactly, so r = 1 by definition and no sample could be more extreme