Hello, I am trying to count the frequency with which two people who are paired up and both choose the number 6 in q.
In the example below, subject 73 and subject 116 are paired up for 10 rounds. I generated variable y to indicate that they are paired up. I would like to find the number of the times they both chose 6 in variable q. For example in round 2, 3, 7, 8, 9. How can I generate a dummy variable indicating this is the case please?
Many thanks!
*Example generated by -dataex-. For more info, type help dataex
clear
input float id byte(round id_in_group_cournot q) int y
73 1 1 7 1
116 1 2 6 1
73 2 1 6 2
116 2 2 6 2
73 3 1 6 3
116 3 2 6 3
73 4 1 6 4
116 4 2 7 4
73 5 1 7 5
116 5 2 6 5
73 6 1 6 6
116 6 2 7 6
73 7 1 6 7
116 7 2 6 7
73 8 1 6 8
116 8 2 6 8
73 9 1 6 9
116 9 2 6 9
73 10 1 7 10
116 10 2 8 10
end
In the example below, subject 73 and subject 116 are paired up for 10 rounds. I generated variable y to indicate that they are paired up. I would like to find the number of the times they both chose 6 in variable q. For example in round 2, 3, 7, 8, 9. How can I generate a dummy variable indicating this is the case please?
Many thanks!
*Example generated by -dataex-. For more info, type help dataex
clear
input float id byte(round id_in_group_cournot q) int y
73 1 1 7 1
116 1 2 6 1
73 2 1 6 2
116 2 2 6 2
73 3 1 6 3
116 3 2 6 3
73 4 1 6 4
116 4 2 7 4
73 5 1 7 5
116 5 2 6 5
73 6 1 6 6
116 6 2 7 6
73 7 1 6 7
116 7 2 6 7
73 8 1 6 8
116 8 2 6 8
73 9 1 6 9
116 9 2 6 9
73 10 1 7 10
116 10 2 8 10
end
Comment