Correlation and Regression Analysis

Correlation and Regression Analysis
Loading the math board and drawing, please wait…
2015-08-04 04:26
This example explores scatterplots, correlation, regression, and residuals using GeoGebra commands such as Polygon, KeepIf, and FitLineY. Suitable for high school and above students to learn statistics and data analysis.

GeoGebra Commands & Parameters

  1. Polygon(A_2, B_2, C_2, D_2) → poly1, a_2, b_2, c_2, d_2
  2. KeepIf(IsInRegion[AA, poly1], AA, {A, A_1, B, B_1, C, C_1, D, D_1, E, E_1, E_2, F, F_1, F_2, G, G_1, H, H_1, I, I_1, J, J_1, K, K_1, L, L_1, M, M_1, N, N_1, O, O_1, P, P_1, Q, Q_1, R, R_1, S, S_1, T, T_1, U, U_1, V, V_1, W, W_1, Z, Z_1}) → list1
  3. FitLineY(list1) → f
  4. Line((MeanX[list1], 0), (MeanX[list1], 1)) → a
  5. PMCC(list1) → e
  6. Segment(W_1, (x(W_1), f(x(W_1)))) → g
  7. Segment(F_2, (x(F_2), f(x(F_2)))) → h
  8. Segment(V_1, (x(V_1), f(x(V_1)))) → i
  9. Segment(E_2, (x(E_2), f(x(E_2)))) → j
  10. Segment(Z_1, (x(Z_1), f(x(Z_1)))) → k
  11. Segment(U_1, (x(U_1), f(x(U_1)))) → l
  12. Segment(T_1, (x(T_1), f(x(T_1)))) → m
  13. Segment(S_1, (x(S_1), f(x(S_1)))) → n
  14. Segment(R_1, (x(R_1), f(x(R_1)))) → p
  15. Segment(Q_1, (x(Q_1), f(x(Q_1)))) → q
  16. Segment(P_1, (x(P_1), f(x(P_1)))) → r
  17. Segment(O_1, (x(O_1), f(x(O_1)))) → s
  18. Segment(N_1, (x(N_1), f(x(N_1)))) → t
  19. Segment(M_1, (x(M_1), f(x(M_1)))) → a_1
  20. Segment(L_1, (x(L_1), f(x(L_1)))) → b_1
  21. Segment(K_1, (x(K_1), f(x(K_1)))) → c_1
  22. Segment(J_1, (x(J_1), f(x(J_1)))) → d_1
  23. Segment(I_1, (x(I_1), f(x(I_1)))) → e_1
  24. Segment(H_1, (x(H_1), f(x(H_1)))) → f_1
  25. Segment(G_1, (x(G_1), f(x(G_1)))) → g_1
  26. Segment(F_1, (x(F_1), f(x(F_1)))) → h_1
  27. Segment(E_1, (x(E_1), f(x(E_1)))) → i_1
  28. Segment(D_1, (x(D_1), f(x(D_1)))) → j_1
  29. Segment(C_1, (x(C_1), f(x(C_1)))) → k_1
  30. Segment(B_1, (x(B_1), f(x(B_1)))) → l_1
  31. Segment(A_1, (x(A_1), f(x(A_1)))) → m_1
  32. Segment(Z, (x(Z), f(x(Z)))) → n_1
  33. Segment(W, (x(W), f(x(W)))) → p_1
  34. Segment(V, (x(V), f(x(V)))) → q_1
  35. Segment(U, (x(U), f(x(U)))) → r_1
  36. Segment(T, (x(T), f(x(T)))) → s_1
  37. Segment(S, (x(S), f(x(S)))) → t_1
  38. Segment(R, (x(R), f(x(R)))) → e_2
  39. Segment(Q, (x(Q), f(x(Q)))) → f_2
  40. Segment(P, (x(P), f(x(P)))) → g_2
  41. Segment(O, (x(O), f(x(O)))) → h_2
  42. Segment(N, (x(N), f(x(N)))) → i_2
  43. Segment(M, (x(M), f(x(M)))) → j_2
  44. Segment(L, (x(L), f(x(L)))) → k_2
  45. Segment(K, (x(K), f(x(K)))) → l_2
  46. Segment(J, (x(J), f(x(J)))) → m_2
  47. Segment(I, (x(I), f(x(I)))) → n_2
  48. Segment(H, (x(H), f(x(H)))) → p_2
  49. Segment(G, (x(G), f(x(G)))) → q_2
  50. Segment(F, (x(F), f(x(F)))) → r_2
  51. Segment(E, (x(E), f(x(E)))) → s_2
  52. Segment(D, (x(D), f(x(D)))) → t_2
  53. Segment(C, (x(C), f(x(C)))) → a_3
  54. Segment(B, (x(B), f(x(B)))) → b_3
  55. Segment(A, (x(A), f(x(A)))) → c_3
  56. Point(d_2) → I_2
  57. Point(b_2) → J_2
  58. Segment(I_2, J_2) → d_3
  59. FitLineY({I_2, J_2}) → e_3