I’m having trouble with doing different regression lines according to a categorical 3rd (“middle-of’-the-graph”) variable, when that variable was originally numeric.

I’m using this file, https://codap.concord.org/app/static/dg/en/cert/index.html#shared=https://cfm-shared.concord.org/UawUu8atSM7s5TuTF7eS/file.json

I make a graph with x=wnh_pct and y=C.A.P. , then drag CompanyNumber to the middle of the graph. Then I click the word “CompanyNumber” in the lower-left of the figure (the legend) to get a menu, and select “Treat as Categorical”. Then I use the ruler icon and ask to add a least-squares line (which really means 3 lines, since CompanyNumber has 3 possible values). No trendlines appear on the graph, and 3 copies of a yellow box appear, saying:

C.A.P.=

r^2=

[That is, there’s nothing after the equals-signs.]

The same thing happens if I add the regression line before dragging CompanyNumber to the middle of the graph.

I had tried posting to the Forum about this a few months ago, but I guess something went wrong in the process of trying to post. Back then, it did make a difference whether the 3rd variable was added before versus after asking for regression line(s), but it just led to 2 different ways of incorrect results. I can’t remember what the other version was, though.

I know that I could have students create a column that does the translation from numeric CompanyNumber to something like CompanyLetter that CODAP would then automatically treat as categorical. But I want part of the exercise to include the switch from numeric to categorical without having to type in a complicated formula to turn the numbers into categories.