Hi Statalist,
I am confused about how to set up my data for sequence and cluster analysis using the Sq-Ados package (SSC, Brzinsky-Fay & Kohler, 2006).
I have data on children in hospitals. Not all children enter the data at the same time, only when they need treatment. The data is in long format, so each child gets a new row when they need a different treatment. For example, a child who needs surgery, then a scan will have two rows (or a sequence of two states) and a child who need surgery, scan, therapy will have three rows (or a sequence of three states). Once children leave the hospital, they no longer have a record in the data.
This means I have sequences of different lengths. In Sq-Ados, the sqset command has the options ltrim, rtrim, trim, and keep longest. From my understanding is that the sequences need to all be of the same length, but because I don’t have any “missing” data, using any of these options doesn’t seem to make a difference. Keeping the data with different sequence lengths, my sqindexplots look weird with large white gaps (which don’t represent any state).
I cannot share an example of my data as I am not allowed (sensitive admin data etc.). I am not sure if I am setting up my data incorrectly? Here is an example of my code:
The plot has large white gaps which does not resemble what the sqindexplot looks like in the help file. I think I’m missing something here?
I am confused about how to set up my data for sequence and cluster analysis using the Sq-Ados package (SSC, Brzinsky-Fay & Kohler, 2006).
I have data on children in hospitals. Not all children enter the data at the same time, only when they need treatment. The data is in long format, so each child gets a new row when they need a different treatment. For example, a child who needs surgery, then a scan will have two rows (or a sequence of two states) and a child who need surgery, scan, therapy will have three rows (or a sequence of three states). Once children leave the hospital, they no longer have a record in the data.
This means I have sequences of different lengths. In Sq-Ados, the sqset command has the options ltrim, rtrim, trim, and keep longest. From my understanding is that the sequences need to all be of the same length, but because I don’t have any “missing” data, using any of these options doesn’t seem to make a difference. Keeping the data with different sequence lengths, my sqindexplots look weird with large white gaps (which don’t represent any state).
I cannot share an example of my data as I am not allowed (sensitive admin data etc.). I am not sure if I am setting up my data incorrectly? Here is an example of my code:
Code:
sqset state ID ordervar sqindexplot, title(“treatment trajectories”) ranks (1/100) color(green pink orange blue).
Comment