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
Replace with previous value, but just 1 year backPlease excuse this very beginner question, but much help would be appreciated! I want to create a v…
tab string variable contains name in Arabic alphabetDear Stata list, I have a dataset which has values of name in Arabic alphabet. It is displaying cor…
creating 1 dataset of frequencies for the same categorical variables that are in 2 different datasetsHi all, I have 2 different individuals-level datasets that share the same categorical variables(e.g…
bar chart dummy percentHey guys, I have a dummy variable (var) for 4 diffrent years. I want to have a bar chart that shows…
coefplot: how to align y-axis and markers?Hi, I'm using -coefplot- to create a graph showing the balance between covariates for a treatment a…
Subscribe to:
Post Comments (Atom)
0 Response to Bar graph showing percentages in each category
Post a Comment