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
Creating a single table from tabulation of many similar variables using asdocI have a dataset that has similar responses to different questions. For example Q1, Q2, Q3, ... Qn h…
Including prevalence ratio in table after glm using asdocHello, I would like to export prevalence ratios into a word table after a glm poisson model using t…
Coefficient omitted due to time fixed effect and multi-collinearityHi All, I am dealing with company level unbalanced panel data (attached). There are broadly two type…
Contingency tables with missing values but chi2 with valid valuesHi everyone, I'am comparing a dichotomic variable between 2 groups. Group n°1 is 199 observations in…
Approximating the degrees of freedom in a multilevel modelHi everybody, I'm trying to estimate a random intercept and slope model, were I estimate the degree…
Subscribe to:
Post Comments (Atom)
0 Response to Bar graph showing percentages in each category
Post a Comment