I am using Stata/IC 14.2 for Windows, and am using the foreach command to graph a horizontal bar graph for a series of unique values (stratified by a numeric variable), See code below.The code runs, but I am wishing to preserve the label from my numeric variable (called "Abbreviation") on the graph, rather than the value itself. Any advice on how to alter my code to display the value label?
The variable called "Abbreviation" is formatted as a numeric float, and has values from 0 to 32.
The variable called "Abbreviation" is formatted as a numeric float, and has values from 0 to 32.
Code:
foreach value in 0 1 2 3 7 8 9 10 11 15 17 19 21 26 27 28 30 32{ local which: label (Abbreviation) `value' graph hbar (mean) nasal if Abbreviation==`value', ylabel(, angle(0)) over(quarter) ytitle("Percent") ylabel(0 "0" .2 "20".4 "40" .6 "60" .8 "80" 1 "100") title ("TITLE GOES HERE" "`value'") graph export "nasal `value'.wmf", replace }
Comment