Residuals on a Scatter Diagram Demo

Residuals on a Scatter Diagram Demo
Loading the math board and drawing, please wait…
2020-01-21 05:13
This example demonstrates plotting residuals on a scatter diagram, involving core math concepts like residuals, scatter plots, linear regression, and PMCC (Pearson's correlation coefficient). Key GeoGebra commands and objects used include Element, Min, Max, If, Sequence, Length, Segment, PMCC, VerticalText, and Text. Suitable for high school mathematics teaching on data fitting and residual analysis.

GeoGebra Commands & Parameters

  1. Element(DtYSq, dataset) → DtY0
  2. Min(DtY0) → YDtMn
  3. Max(DtY0) → YDtMx
  4. Element(DtXSq, dataset) → DtX0
  5. Min(DtX0) → XMn
  6. Max(DtX0) → XMx
  7. If((5 * XScLB) ≤ XScUB, (5 * XScLB), If[(2 * XScLB) ≤ XScUB, (2 * XScLB), XScLB]) → XAxSc
  8. Sequence(Mod[3 + (17 * k), 37] + 30, k, 1, 32) → OpSq
  9. Element(OpSq, dataset) → OpNm1
  10. Element(DtPlSq, Op1) → DtPl
  11. Min(XMnYht, XMxYht) → RgLnMn
  12. Min(RgLnMn, YDtMn) → YMn
  13. Max(XMnYht, XMxYht) → RgLnMx
  14. Max(RgLnMx, YDtMx) → YMx
  15. If((5 * YScLB) ≤ YScUB, (5 * YScLB), If[(2 * YScLB) ≤ YScUB, (2 * YScLB), YScLB]) → YAxSc
  16. Length(DtX0) → Size
  17. Segment(GrOr, GrLR) → grhax
  18. Segment(GrOr, GrUL) → grvax
  19. Segment(RgLnLf, RgLnRt) → grrgln
  20. PMCC(DtX0, DtY0) → R
  21. Sequence(Text[k, (AdpX(k) - 0.8, -2.2)], k, XAxMn, XAxMx, XAxSc) → XAxLb
  22. Sequence(Text[k, (-5, AdpY(k) - 0.35)], k, YAxMn, YAxMx, YAxSc) → YAxLb_1
  23. Sequence(AdpX(Element[DtX0, k]), k, 1, Size) → PltX
  24. Sequence(AdpY(Element[DtY0, k]), k, 1, Size) → PltY
  25. Sequence((Element[PltX, k], Element[PltY, k]), k, 1, Size) → DtPnts
  26. Element(XAxTtlSq, dataset) → XAxTtl
  27. Sequence(Segment[(0, AdpY(k)), (XScMx, AdpY(k))], k, YAxMn, YAxMx, YAxSc) → HrzGrd
  28. Sequence(Segment[(AdpX(k), 0), (AdpX(k), GrTp)], k, XAxMn, XAxMx, XAxSc) → VrtGrd
  29. VerticalText(Element[YAxTtlSq, dataset], (-9, 32)) → YAxLb
  30. Element(DtX0, seed) → Xdt
  31. Element(DtY0, seed) → Ydt
  32. Segment(DtPt, PrdPt) → Rsd
  33. Segment(DtPtY, DtPt) → YDtLn
  34. Segment(PrdPtY, PrdPt) → PrdLn
  35. Min(Ydt, YhtDt) → YRsd
  36. Segment(YRsdPt, DtPtX) → XdtLn
  37. VerticalText("X Value", (AdpX(Xdt) - 1.5, 0)) → XVlLb
  38. Text("Actual Y Value", (-15, AdpY(Ydt)) - 0.5) → ActYLb
  39. Text("Predicted Y Value", (-19, AdpY(YhtDt)) - 0.5) → PrdYLb
  40. Text("Residual", RsdLbPt) → RsdLbl

AI Drawing Prompt Reference

Draw a scatter plot showing data points and their residuals. First, draw the X and Y axes, then plot the data points and calculate the residuals. Next, draw the regression line and residual lines for each data point. Finally, label the X-axis with X values and the Y-axis with actual Y values, predicted Y values, and residuals.
The prompt above was compiled from the original drawing commands and is for reference only.