I need to offset actual values of variable dev_all_gr on the y axis of a striplot (from ssc), and label them for clarity. I have defined the labels for the points I would like to label as follows:
In the striplot code, I then define these points as those I would like to label, and use the valuelabel command to use the defined labels rather than the actual values:
The valuelabel option on the x axis provides the correct result; however that on the y axis stubbornly insists on giving underlying values rather than labels. Could this possibly be because none of my data points map exactly to the (underlying) labelled values? Is there a way to resolve this? (I tried a workaround with labmask but it does not work because my values are not integers.) Herewith a data extract for replication. Thanks for any help
Code:
lab def graph_scale -55 "-50" -15 "-10" -10 "-5" -5 "None" 5 "None" 10 "5" 15 "10" 55 "50" 105 "100" lab val dev_all_gr graph_scale
Code:
stripplot dev_all_gr, over(molnum) stack height(0.6) ms(circle circle diamond diamond square square triangle) vertical yla(, ang(h)) separate(inn_disp) mlcolor(orange purple orange purple orange purple white) mcolor(orange*0.4 purple*0.4 orange*0.4 purple*0.4 orange*0.4 purple*0.4 white) msize(vsmall vsmall vsmall vsmall vsmall vsmall tiny) /// ylabel(-55 -15 -10 -5 5 10 15 55 105,labsize(vsmall) valuelabel) /// ytitle("Deviation from permitted limits, in percent", size(vsmall) margin(r=2)) /// yline(-5 5, lpattern(dash) lcolor(green)) width(2) /// xscale(r(0.5 5.5)) xlabel(, valuelabel labsize(vsmall)) xtitle("") /// text(1 2 "Notional range of acceptability", color(green) size(tiny)) /// legend(order(1 "Failed assay" 3 "Failed dissolution" 5 "Failed assay and dissolution") rows(1) size(vsmall) region(lcolor(gray*.3))) /// note("Orange markers: Branded; Purple markers: Unbranded", size(vsmall)) /// plotregion(lstyle(none))
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(inn_disp dev_all_gr) byte molnum 1 -5.19 5 6 -9.7 1 2 11.53 1 4 -44.07 1 4 -54 1 4 -53.54 1 4 -49.75 1 4 -10.8 4 3 -5.32 5 1 -12.03 3 1 -12.85 3 1 -5.77 3 1 -11.09 3 3 -6.08 3 3 -5.02 3 4 -5.02 5 6 -9.55 5 4 -5.52 5 6 -8.3 5 4 -6.38 5 end label values dev_all_gr graph_scale label values molnum molnum label def molnum 1 "Allopurinol", modify label def molnum 3 "Amoxicillin", modify label def molnum 4 "Dexamethasone", modify label def molnum 5 "Cefixime", modify
Comment