Hi,
I am doing a two-way contour graph of patients and their respective organ failure score for each day in the hospital. I noticed that the width of a single patients differ, which make no logical sense. See attached files. First pic is a example of different patient groups and their respective organ failure scores each day. The second graph is a close-up of the third cluster of patients (just for example). I have modified the data so each patient have the same score over all days.
The thing is, the width of individual patients differ between each other. Anyone have an idea why this is the case?
Parts of my dataset (the total dataset comprises 720 patients, all observed during 29 days:
obs == observation number
day == respective day in hospital (can take values between 0 to 28)
cs6 == cluster assignment (can take values between 1 to 6)
sofa_coag_ == failure score for coagulation (can take values between 0 to 4). I have to make my example clearer assigned a score of 0 or 4 alternating for each patient in cluster 3.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float obs byte(day cs6) float sofa_coag_ 593 0 3 4 593 1 3 4 593 2 3 4 593 3 3 4 593 4 3 4 593 5 3 4 593 6 3 4 593 7 3 4 593 8 3 4 593 9 3 4 593 10 3 4 593 11 3 4 593 12 3 4 593 13 3 4 593 14 3 4 593 15 3 4 593 16 3 4 593 17 3 4 593 18 3 4 593 19 3 4 593 20 3 4 593 21 3 4 593 22 3 4 593 23 3 4 593 24 3 4 593 25 3 4 593 26 3 4 593 27 3 4 593 28 3 4 594 0 3 0 594 1 3 0 594 2 3 0 594 3 3 0 594 4 3 0 594 5 3 0 594 6 3 0 594 7 3 0 594 8 3 0 594 9 3 0 594 10 3 0 594 11 3 0 594 12 3 0 594 13 3 0 594 14 3 0 594 15 3 0 594 16 3 0 594 17 3 0 594 18 3 0 594 19 3 0 594 20 3 0 594 21 3 0 594 22 3 0 594 23 3 0 594 24 3 0 594 25 3 0 594 26 3 0 594 27 3 0 594 28 3 0 595 0 3 4 595 1 3 4 595 2 3 4 595 3 3 4 595 4 3 4 595 5 3 4 595 6 3 4 595 7 3 4 595 8 3 4 595 9 3 4 595 10 3 4 595 11 3 4 595 12 3 4 595 13 3 4 595 14 3 4 595 15 3 4 595 16 3 4 595 17 3 4 595 18 3 4 595 19 3 4 595 20 3 4 595 21 3 4 595 22 3 4 595 23 3 4 595 24 3 4 595 25 3 4 595 26 3 4 595 27 3 4 595 28 3 4 596 0 3 0 596 1 3 0 596 2 3 0 596 3 3 0 596 4 3 0 596 5 3 0 596 6 3 0 596 7 3 0 596 8 3 0 596 9 3 0 596 10 3 0 596 11 3 0 596 12 3 0 end
My code for the two-way contour graph, i have added x-axis labels below specific clusters hence the "xlabel"-code.:
Code:
twoway contour sofa_coag_ day obs, levels(5) interp(none) levels(5) zlabel(#5) xtitle(clusters) xlabel(23 "CS1" 320 "CS2" 600 "CS3" 666"CS4" 773 "CS5" 891 "CS6") ccolors(blue green yellow orange red) name(Coag_utv2) heatmap
As you can see in the close-up, some patients have double width compared to others. It gives the impression that two adjacent patients, in my example, have the same score (which they do not have). In total there are 15 patients in cluster 3, in this graph it looks like it is 23 patients.
Any suggestions why?
All the best,
Jesper Eriksson
0 Response to Twoway contour graph (heatmap) incorrectly assigns width of observation
Post a Comment