Hi,
I hope you are all well and safe!
I am plotting standardized outcome measures at admission and discharge from a rehabilitation stay grouped by age. Age is ordinal with 4 categories and the outcome measures are score_admission and score_discharge. I can generate a boxplot but would like something closer to what would could be generated with stripplot.
This is the boxplot:
I would like to use stripplot, but I only seem to be able to use one of the scores:
This is the code for the stripplot:
Data in case it helps (sorry for the length - needed a few observations in each category):
Thanks!
Marc
I hope you are all well and safe!
I am plotting standardized outcome measures at admission and discharge from a rehabilitation stay grouped by age. Age is ordinal with 4 categories and the outcome measures are score_admission and score_discharge. I can generate a boxplot but would like something closer to what would could be generated with stripplot.
This is the boxplot:
I would like to use stripplot, but I only seem to be able to use one of the scores:
This is the code for the stripplot:
Code:
stripplot score_admission, over(age) box blcolor(white) iqr jitter(3) stack h(0.5) vertical mcolor(blue)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(age score_admission score_discharge) 1 64 82 1 50 80 1 40 75 1 69 87 1 62 104 1 53 85 1 78 118 1 31 76 1 48 47 1 59 96 2 50 69 2 40 46 2 71 113 2 83 117 2 51 85 2 60 99 2 54 50 2 84 117 2 81 104 2 50 49 3 66 78 3 34 55 3 67 71 3 59 76 3 85 103 3 91 112 3 57 68 3 49 60 3 46 71 3 53 83 4 80 78 4 61 58 4 62 95 4 52 63 4 76 102 4 71 97 4 26 37 4 48 58 4 35 59 4 83 75 end label values age age label def age 1 "18-44", modify label def age 2 "45-64", modify label def age 3 "65-74", modify label def age 4 "75+", modify label var age "Age Category" label var score_admission "Score at Admission" label var score_discharge "Score at Discharge"
Marc
Comment