Guess the Correlation Coefficient

Guess the Correlation Coefficient
Loading the math board and drawing, please wait…
2020-01-17 22:12
This example demonstrates different data sets to help students understand the meaning of the correlation coefficient. Key mathematical concepts include correlation coefficient, linear regression, and linear equations. Using GeoGebra commands such as `SelectedIndex`, `RandomUniform`, and `PMCC`, dynamic data sets are generated and the correlation coefficient is calculated. Suitable for high school and above students to learn about the concept and application of the correlation coefficient.

GeoGebra Commands & Parameters

  1. SelectedIndex(models) → chosenmodel
  2. Sequence(Max[-4, Min[RandomNormal[0, 1], 4]], i, 1, 100) → xlistNormal
  3. RandomUniform(1, 3) → b
  4. RandomUniform(0.6, 1.5) → a
  5. RandomUniform((-sqrt((b + 4) / a)), sqrt((b + 4) / a), 100) → xlistOther
  6. If(chosenmodel ≟ 1, xlistNormal, xlistOther) → xlist
  7. RandomUniform(-1, 1) → rho
  8. Zip(Max[-4, Min[(rho * xx) + (sqrt(1 - rho^(2)) * RandomNormal[0, 1]), 4]], xx, xlist) → ylistNormal
  9. Zip(Max[-4, Min[f(xx) + RandomNormal[0, c], 4]], xx, xlist) → ylistOther
  10. If(chosenmodel ≟ 1, ylistNormal, ylistOther) → ylist
  11. Zip((xx, yy), xx, xlist, yy, ylist) → xylist
  12. PMCC(xylist) → r
  13. FitLineY(xylist) → rline
  14. Polygon(Corner[2], Corner[3], (0.75 * Corner[3]) + (0.25 * Corner[4]), (0.75 * Corner[2]) + (0.25 * Corner[1])) → panel, g, h, i, j
  15. If(abs(guess - r) > 0.2, 0, If[0.1 < abs(guess - r) ≤ 0.2, 1, If[abs(guess - r) ≤ 0.1, 2, 3]]) → guessstate
  16. Textfield(guessinput) → InputBox1