Finding Outliers in a Scatter Diagram

Finding Outliers in a Scatter Diagram
Loading the math board and drawing, please wait…
2018-01-30 02:54
This example demonstrates how to identify outliers in a scatter diagram. Key mathematical concepts include statistical methods for outlier detection. Construction highlights the use of GeoGebra commands such as Sequence, Max, Min, MeanY, MeanX, etc., for data sorting and statistical analysis. Suitable for high school and above students or teachers.

GeoGebra Commands & Parameters

  1. Sequence(RandomPoisson[seed], k, 1, (2 * size)) → RandList
  2. Sequence((Element[RandList, (2 * k)] * 10^((-Acc2))), k, 1, size) → Yvals
  3. Sequence((Element[RandList, (2 * k) - 1] * 10^((-Acc1))), k, 1, size) → Xvals
  4. Max(Xvals) → Max1
  5. Min(Xvals) → Min1
  6. Sequence((Element[Xvals, k], Element[Yvals, k]), k, 1, size) → ActPts
  7. MeanY(ActPts) → Ybar
  8. MeanX(ActPts) → Xbar
  9. SXY(ActPts) → ActSxy
  10. SXX(ActPts) → ActSxx
  11. Sequence(((Element[Xvals, k] - Xbar) * Cos) + ((Element[Yvals, k] - Ybar) * Sine), k, 1, size) → Xrot
  12. Sequence((Element[Xrot, k] * Cos) + Xbar, k, 1, size) → Xproj
  13. Max(Xproj) → Max3
  14. Min(Xproj) → Min3
  15. Min(Yvals) → Min2
  16. Sequence((Element[Xrot, k] * Sine) + Ybar, k, 1, size) → Yproj
  17. Min(Yproj) → Min4
  18. Max(Yvals) → Max2
  19. Max(Yproj) → Max4
  20. Max(Max2, Max4) → MaxY
  21. Max(RightEnd - LeftEnd, TopEnd - BotEnd) → StrFac
  22. Max(Max1, Max2) → Max0
  23. Min(Min1, Min2) → Min0
  24. Sequence(((-(Element[Xvals, k] - Xbar)) * Sine) + ((Element[Yvals, k] - Ybar) * Cos), k, 1, size) → Yrot
  25. Sequence(adapt1(Element[Xvals, k]), k, 1, size) → Xgrph
  26. Sequence(adapt2(Element[Yvals, k]), k, 1, size) → Ygrph
  27. Sequence(k, k, Min1, Max1, 10^((-Acc1))) → Domain
  28. Sort(Intersection[Domain, Xvals]) → Range
  29. CountIf(x < Max1 + 1, Range) → RangeCount
  30. Sequence((Element[Xgrph, k], Element[Ygrph, k]), k, 1, size) → GrphPts
  31. Segment((-1.414, -1.414), (0, 0)) → LLC
  32. Sequence(Segment[(-0.5, (k * Stretch2)), (0.5, (k * Stretch2))], k, 0, TopEnd - BotEnd, (0.5 * 10^((-Acc2) + 1))) → Vtics
  33. FitLineY(ActPts) → FL
  34. Mean(Xgrph) → Xmean
  35. Mean(Ygrph) → Ymean
  36. Sequence(((-(Element[Xgrph, k] - Xmean)) * sin(Theta)) + ((Element[Ygrph, k] - Ymean) * cos(Theta)), k, 1, size) → Yrot1
  37. Sequence(abs(Element[Yrot, k]), k, 1, size) → Yabs
  38. Sequence(((Element[Xgrph, k] - Xmean) * cos(Theta)) + ((Element[Ygrph, k] - Ymean) * sin(Theta)), k, 1, size) → Xrot1
  39. Sequence(((Element[Xrot1, k] * cos(Theta)) + Xmean, (Element[Xrot1, k] * sin(Theta)) + Ymean), k, 1, size) → RegProj
  40. Sequence((Element[Xproj, k], Element[Yproj, k]), k, 1, size) → ActPrjPts
  41. Sequence(adapt1(Element[Xproj, k]), k, 1, size) → Xprgr
  42. Sequence(adapt2(Element[Yproj, k]), k, 1, size) → Yprgr
  43. Sequence((Element[Xprgr, k], Element[Yprgr, k]), k, 1, size) → GrphPrjPts
  44. Sequence(Segment[Element[GrphPts, k], Element[GrphPrjPts, k]], k, 1, size) → ProjLines
  45. Sequence(Element[Xgrph, k] - 2, k, 1, size) → Xlbl
  46. Sequence(If[Element[Yabs, k] ≠ 0, Element[Yrot, k] / Element[Yabs, k], 1], k, 1, size) → LblDir
  47. Sequence(Element[Ygrph, k] + (Element[LblDir, k] * 1.5) - 0.5, k, 1, size) → Ylbl
  48. Sequence(Text[Element[Yabs, k], (Element[Xlbl, k], Element[Ylbl, k])], k, 1, size) → DstLbl
  49. Max(Yabs) → MaxDist
  50. Sequence(If[Element[Yabs, k] ≟ MaxDist, Text["OUTLIER", (Element[Xgrph, k] - 3, Element[Ygrph, k] + (Element[LblDir, k] * 3) - 0.5)], Text[" "]], k, 1, size) → Outlier
  51. Segment(AxesOrigin, HAE) → Haxis
  52. Segment(AxesOrigin, VAE) → Vaxis
  53. FitLineY(GrphPts) → RegLine
  54. Intersect(Right, RegLine) → B
  55. Sequence(Segment[((k * Stretch1), -3.5), ((k * Stretch1), -2.5)], k, 0, RightEnd - LeftEnd, (0.5 * 10^((-Acc1) + 1))) → Htics
  56. Sequence(Text[k, (adapt1(k) - 0.9, -5.5)], k, LeftEnd, RightEnd, 10^((-Acc1) + 1)) → Hlab
  57. Sequence(Text[k, (-4.5, adapt2(k)) - 0.5], k, BotEnd, TopEnd, Step) → Vlab

AI Drawing Prompt Reference

Create a scatter plot and identify outliers. First, generate a set of random data points, then calculate the maximum and minimum values, mean, and variance for both X and Y. Rotate the points, compute their projections, and find the maximum and minimum values of these projections. Finally, draw a regression line and label the distance of each point to the line.
The prompt above was compiled from the original drawing commands and is for reference only.