July 12, 2021 at 9:39 pm #6560Andrew RossParticipant
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 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:
[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.July 16, 2021 at 3:39 pm #6592Bill FinzerKeymaster
You’ve definitely uncovered a bug. Switching the legend attribute to categorical should produce the three lines. We’ll fix it!
Meanwhile, here’s another workaround that might work for your students:
- Drag Company Number all the way to the left in the case table so that you get a new table with just three rows.
- Edit the three numbers so they are no longer pure numbers. (In the screen shot you’ll see that I just added the letter ‘A’ after each.)
- Now, as shown in the screenshot, the desired three lines appear.
Hope this helps. And sorry for the trouble posting.
- This reply was modified 2 weeks, 2 days ago by Bill Finzer.
- You must be logged in to reply to this topic.