I'm trying to plot diagnostic data from a clinical trail and color code them according to the number of standard deviations from the mean as well as label those values >1.5*IQR. This is to compare the two treatment groups and visualise potential outliers.
I've discovered the very useful stripplot and managed to add value labels using a variable 'mylabel' (all observations <1.5*IQR are defined as missing). To color the individual points by category, I created a variable cat_SD sorting the observations according to the number of standard deviations from the mean cat_SD = {1,2,3,4,5}. This was done by treatment group. I used separate() option to color individual points by their respective category.
The issue I have is that each on their own (value or color) works very well, but if I add them both together, the value labels of the SD categories >1 disappear. (The code I used is below.)
Would anyone have a suggestion on how I can add both value label and category into the plot? Also if someone knows a different way to label the values so that 'unlabeled' values are not labeled with a "." that would also be much appreciated.
If it is of importance: I'm using Stata13 for Windows and am very new to Stata.
Thanks for your help!
I've discovered the very useful stripplot and managed to add value labels using a variable 'mylabel' (all observations <1.5*IQR are defined as missing). To color the individual points by category, I created a variable cat_SD sorting the observations according to the number of standard deviations from the mean cat_SD = {1,2,3,4,5}. This was done by treatment group. I used separate() option to color individual points by their respective category.
The issue I have is that each on their own (value or color) works very well, but if I add them both together, the value labels of the SD categories >1 disappear. (The code I used is below.)
Would anyone have a suggestion on how I can add both value label and category into the plot? Also if someone knows a different way to label the values so that 'unlabeled' values are not labeled with a "." that would also be much appreciated.
If it is of importance: I'm using Stata13 for Windows and am very new to Stata.
Thanks for your help!
Code:
*Figure1: Add value labels for values > IQR*1.5 stripplot d_HA , over(treatment) vertical cumul centre box iqr refline ytitle("concentration (nM)") mlabel(mylabel) *Figure2: Color markers according to SD category 1-5 stripplot d_HA , over(treatment) vertical cumul separate(cat_SD) centre box iqr refline ytitle("concentration (nM)") *Figure3: Add value labels and color markers --> removes labels from all categories >1 stripplot d_HA , over(treatment) vertical cumul separate(cat_SD) centre box iqr refline ytitle("concentration (nM)") mlabel(mylabel)
Comment