I have:
Y X
1 1
1 0
1 1
2 1
2 0
I want to have a bar graphs that displays two bars for each value of Y variable, displaying percentage of X=1 for each category.
graph bar (percent) X, over(Y) produces this (not sure what the utility of that is):
1 60%
2 40%
graph bar X, over(Y) produces this:
1 0.67
2 0.5
I cannot find out how to make what I want:
1 67%
2 50%
Is there a clear and easy way to do that with bar graph command without creating any more variables?
Related Posts with Bar graph showing percentages in each category
Generating unique id across variablesHello I have data in the following format where each firm is audited by either 1 or two auditors. …
Import excel dataset to Stata with MM/DD/YYYY dates as 1st row / variableHi, I currently have a dataset that looks like that in Excel: Code: Code: * Example generated …
Identify variables by their order in the datasetHi, I am working with a new feed of data every week (in real time). Therefore, as real time passes …
Metaprop Forestplot EditingHello, I am trying to perform a proportion meta-analysis. The dataset is https://imgur.com/F0Eikiz …
PSM (ATET and ATE)Hi all, I will really appreciate your help on this. I estimated my analysis using the PSM method in…
Subscribe to:
Post Comments (Atom)
0 Response to Bar graph showing percentages in each category
Post a Comment