Scatterplot sliders to a table

Hi there. So I am teaching regression. I have successfully created a slide where students enter a y-value for data and the points appear on a graph. The following slide correctly calculates the Peason’s r coefficient.

What I am trying to do on the next two slides is use a sliding point to auto-fill in the y-values on the table. I have the graph with points at (1,1), (2,1) … (10, 1) that are set to slide vertically. I want whatever value the points stop on to automatically show up in the y column of the table on the same slide.

What I tried is saving the y values as a numeric list from the graph using:
y1 = graph3.labelNumericValue(“y_1”)

and then having those values populate in the y column on the table using:
numericValue(“y”): graph1.labelNumericValue(y1)

but I get the error that “Parameters to sinks and sources must be constant”

Can anyone help? Here’s the link to my activity so you can see how the table to graph activity works and what I want the sliders on slide 3 to do. Thanks!

1 Like

A few things. First, I believe labelNumericValue just tries to take the label for a point in number form where the parameter is the name of the point, but you don’t have any labels and it won’t accept lists.
Second, you can’t populate a table with a list, you have to populate each cell separately.
Here’s you can do it in the table CL (I changed the y_1 to Y, so it was easier to type):

cellContent(1,2): `${graph3.number(`Y[1]`)}`
cellContent(2,2): `${graph3.number(`Y[2]`)}`
cellContent(3,2): `${graph3.number(`Y[3]`)}`

Note: I’m referring to each element of list Y using brackets

1 Like

That gives me a good start, but now the table is only showing the “default” values that I input to the original table (1,1), (2,1), etc. The slider moves, but the values in the y column are static. I wasn’t able to rename the y value like you suggested (kept saying “y not found”). Here’s the code I used in the table CL. I don’t have anything in the graph CL:

cellContent(1,2): ${graph3.number(y_1[1])}
cellContent(2,2): ${graph3.number(y_1[2])}
cellContent(3,2): ${graph3.number(y_1[3])}

Suggestions here? Thanks for the help so far!

1 Like

I used capital Y, and it seemed to work fine. You need to change the column heading in the graph’s table to that as well.

1 Like

Thanks! I took a look at it. I was sourcing the wrong stupid graph b/c I was editing on the wrong slide. That’s why it wasn’t working. :slight_smile: Appreciate the help.