Reply To: Use Sampler to model conditional probability

#15772
Lee Creighton
Participant

I think we were on the same track. I gave this more work today before seeing your answer, and have it here:

https://codap.concord.org/app/static/dg/en/cert/index.html#shared=https%3A%2F%2Fcfm-shared.concord.org%2FXMZyLuacWYQkoMokVwd4%2Ffile.json

Essentially, I used two samplers: one to generate random draws of two pens, and another to select the genders (without replacement, so I got one boy and one girl in random order). This felt like the natural way to gether samples. (I didn’t know that I could use count(output, output=filter)like you did—neato.)

I then made a new column in the samples table to count how many broken pens there were in each sample. And I got stuck there.

Do you think there’s a way to proceed with my setup? I tried using a histogram to only select those where there was only one broken pen, but I saw no way to check if the pen was assigned to a girl. I made a 2×2 graph showing boy/girl and broken/not broken with only the (broken count==1) points, but if I added more rows to the table, I had to manually go back and re-select only the (broken count==1) rows again. Plus, the 2×2 graph shows double information.