Hi, I have a small dataset below, which is about a table of the disciplinary action predicted probabilities
that students from different ethnic groups may face after different levels of disciplinary infractions.
clear
input byte race outcome infraction1 infraction2 infraction3
1 1 0.684 0.699 0.229
2 1 0.690 0.465 0.127
3 1 0.712 0.577 0.291
4 1 0.718 0.547 0.148
1 2 0.284 0.388 0.527
2 2 0.255 0.390 0.368
3 2 0.240 0.329 0.433
4 2 0.235 0.353 0.392
1 3 0.069 0.146 0.354
2 3 0.056 0.148 0.511
3 3 0.050 0.094 0.277
4 3 0.048 0.111 0.418
end
Among them,
race--1(black);
race--2-hispanic;
race--3-White;
race--4-Other
outcome-1 (receiving minor disciplinary);
outcome-2-(receiving medium disciplinary action);
outcome-3- (receiving severe disciplinary action)
infraction1-(the predicted probability of receiving minor disciplinary action);
infraction2- (the predicted probability of receiving medium disciplinary action);
infraction3- (the predicted probability of receiving severe disciplinary action)
What I want is to write Stata code to achieve the requirements below,
To aid in the visualization of the results (utilizing the updated predicted probabilities), it would be beneficial to compile a set of bar graphs.
A potential approach involves generating 3 bar graphs corresponding to each infraction type (1, 2, and 3).
For instance, the initial bar graph would depict the likelihood, based on race, of students who engage in minor infractions
receiving either low, medium, or high levels of disciplinary action.
Thank you for your Stata code or guidance.
Comment