Dear Statalist.
I have panel data with annual observations (waves) for each “id”. Id may enter the data in different years. I have both predictors that vary over years for id and predictors that do not vary for id. Main outcome of interest is “event”. I also have a competing risk outcome “competing_event”. Please see a simplified example of the data structure below.
My question is whether I can estimate strreg with this data structure, or if I need to restructure the data? The data structures in the “multiple records per subject” examples in the Stata manual are different from my data structure.
Any comments or inputs on this would be greatly appreciated.
Thanks!
Best,
Erik
I have panel data with annual observations (waves) for each “id”. Id may enter the data in different years. I have both predictors that vary over years for id and predictors that do not vary for id. Main outcome of interest is “event”. I also have a competing risk outcome “competing_event”. Please see a simplified example of the data structure below.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(id year x1 x2 event competing_event) 1 1 1 1 0 0 1 2 1 2 0 0 1 3 1 4 0 1 1 4 1 5 0 . 1 5 1 2 1 . 2 2 0 2 0 0 2 3 0 4 0 0 2 4 0 5 0 0 2 5 0 2 1 0 2 6 0 0 . 0 2 7 0 0 . 1 3 6 1 0 0 0 3 7 1 0 0 0 3 8 1 0 0 0 3 9 1 0 0 0 3 10 1 0 0 0 end
Any comments or inputs on this would be greatly appreciated.
Thanks!
Best,
Erik