Hi Everyone,
I am confused about how to draw a bar chart to show mean of different not-mutually exclusive groups together. Consider I have a variable FD for each player (observation). There are two treatments 1 and 5 in my data. In Treatment 5 there is only one round and Treatment 1 there are 8 rounds. Role of the participant can be Member or a Leader. Finally, L_for_round implies number of time someone got the chance to be the leader in that round i.e. 1, 2, 3,....,6. The structure of the data is given below.
I want to achieve a bar chart that shows the mean (preferably with standard errors) of variable FD for Treatment 5, Treatment 1 and then sub-groups of Treatment 1 i.e. L_for_round categorical variable. Notice that, for L_for_round variable, I only want it for Treatment 1. This is because otherwise L_for_round for Treatment 5 is same as Treatment 5 bar as there is only one round in Treatment 5. I want all these bars to be on the same graph. I am not sure how to achieve that. I have tried designplot package as well but it did not work. I will appreciate any help.
I am confused about how to draw a bar chart to show mean of different not-mutually exclusive groups together. Consider I have a variable FD for each player (observation). There are two treatments 1 and 5 in my data. In Treatment 5 there is only one round and Treatment 1 there are 8 rounds. Role of the participant can be Member or a Leader. Finally, L_for_round implies number of time someone got the chance to be the leader in that round i.e. 1, 2, 3,....,6. The structure of the data is given below.
I want to achieve a bar chart that shows the mean (preferably with standard errors) of variable FD for Treatment 5, Treatment 1 and then sub-groups of Treatment 1 i.e. L_for_round categorical variable. Notice that, for L_for_round variable, I only want it for Treatment 1. This is because otherwise L_for_round for Treatment 5 is same as Treatment 5 bar as there is only one round in Treatment 5. I want all these bars to be on the same graph. I am not sure how to achieve that. I have tried designplot package as well but it did not work. I will appreciate any help.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str8 participantcode byte(Treatment Round) str6 Role float L_for_round byte FD "01i96q4o" 5 1 "Member" . 50 "0k4m3rjj" 5 1 "Member" . 50 "0r52g151" 5 1 "Member" . 50 "0sepioso" 5 1 "Leader" 1 50 "0wu2hf6m" 5 1 "Leader" 1 40 "140pb8xq" 1 1 "Member" . 50 "140pb8xq" 1 2 "Leader" 1 50 "140pb8xq" 1 3 "Member" . 50 "140pb8xq" 1 4 "Leader" 2 50 "140pb8xq" 1 5 "Member" . 50 "140pb8xq" 1 6 "Member" . 50 "140pb8xq" 1 7 "Member" . 30 "140pb8xq" 1 8 "Member" . 50 "142go7vd" 1 1 "Member" . 50 "142go7vd" 1 2 "Leader" 1 50 "142go7vd" 1 3 "Member" . 50 "142go7vd" 1 4 "Member" . 50 "142go7vd" 1 5 "Leader" 2 50 "142go7vd" 1 6 "Member" . 50 "142go7vd" 1 7 "Leader" 3 50 "142go7vd" 1 8 "Leader" 4 50 "16jax1a3" 5 1 "Leader" 1 50 "18ld3p88" 1 1 "Member" . 50 "18ld3p88" 1 2 "Leader" 1 50 end label values Treatment Treatment2 label def Treatment2 1 "Random 8R", modify label def Treatment2 5 "Random 1R", modify