I have this data and would like to conduct a mixed model analysis to determine the following:
Effect of individual capacity measures on survival in each of the treated groups
Effect of median capacity measures on survival in each of the treated groups
I would also like to be able to graph this data if possible. In my real data, visit days can be up to 20 visits with corresponding measures. There are no missing values for any of the subjects.
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
The code I am using is
xtmixed capacitymedian treat#visitday || id:
But this gives me the calculation for each individual visit. What I would like to compare is the treated groups and their differences in survival to see whether survival is improved in the treated groups with higher capacity values.
Effect of individual capacity measures on survival in each of the treated groups
Effect of median capacity measures on survival in each of the treated groups
I would also like to be able to graph this data if possible. In my real data, visit days can be up to 20 visits with corresponding measures. There are no missing values for any of the subjects.
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(id visitday treat capacity1 capacity2 capacity3 died) float capacitymedian 30 1 0 22 32 30 1 30 30 2 0 23 34 55 1 34 30 3 0 28 28 43 1 28 30 4 0 25 33 40 1 33 44 1 1 6 4 10 0 6 44 2 1 10 9 12 0 10 44 3 1 6 8 8 0 8 28 1 1 10 5 8 0 8 28 2 1 11 12 9 0 11 28 3 1 8 13 10 0 10 28 4 1 9 8 6 0 8 28 5 1 7 8 9 0 8 28 6 1 11 8 10 0 10 end
The code I am using is
xtmixed capacitymedian treat#visitday || id:
But this gives me the calculation for each individual visit. What I would like to compare is the treated groups and their differences in survival to see whether survival is improved in the treated groups with higher capacity values.
