Hello All,
I am trying to produce a horizontal bar graph using 3 categorical variables
1. akps (measure of a patients function): 10 categories, 0-100
2. phase3 (phase of palliative illness): 4 cats, stable, unstable, deteriorating and dying
3. setting: 4 cats, hospital, hospice, community
I want to display the percentage distribution for the akps categories in each setting, with a separate graph for each phase. The point is to see whether the distribution for akps in each phase is similar across settings. I want to display the proportions because there is an uneven number of cases in each setting which makes patterns using the counts less clear, and stretches the graph.
Using catplot from SCC in stata 13, i have produced this....
catplot setting, over(akps) by(phase3) asyvars

And using graph hbar, i have produced the exact same graph....
gen count=1
replace count=. if akps==.
graph hbar (sum)count, over(setting) over(akps) by(phase3) asyvars
I would be grateful for advice on how to achieve the desired display of percentages - I have been trying various combinations and re-structures for some time now and unfortunately cannot resolve it.
Your help is much appreciated.
Many thanks,
Joanna
I am trying to produce a horizontal bar graph using 3 categorical variables
1. akps (measure of a patients function): 10 categories, 0-100
2. phase3 (phase of palliative illness): 4 cats, stable, unstable, deteriorating and dying
3. setting: 4 cats, hospital, hospice, community
I want to display the percentage distribution for the akps categories in each setting, with a separate graph for each phase. The point is to see whether the distribution for akps in each phase is similar across settings. I want to display the proportions because there is an uneven number of cases in each setting which makes patterns using the counts less clear, and stretches the graph.
Using catplot from SCC in stata 13, i have produced this....
catplot setting, over(akps) by(phase3) asyvars
And using graph hbar, i have produced the exact same graph....
gen count=1
replace count=. if akps==.
graph hbar (sum)count, over(setting) over(akps) by(phase3) asyvars
I would be grateful for advice on how to achieve the desired display of percentages - I have been trying various combinations and re-structures for some time now and unfortunately cannot resolve it.
Your help is much appreciated.
Many thanks,
Joanna
Comment