Hello,
I'm using Stata 18 with the following data:
I have stset my data like so:
and am exploring differences in survival functions stratified by categorical variables in the dataset. I'm having no trouble using the log-rank test with binary categorical variables like age_cat and race_diff, but I cannot find a straightforward way to test the equality of survivor functions stratified by educ_hus and income_quartiles with output for pairwise comparisons and adjustment for multiple comparisons. If anyone can share with me how to approach this, I would appreciate it.
-Meghan
I'm using Stata 18 with the following data:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int id byte divorce float(educ_hus Black_hus race_diff) double(marriage_dur age) float age_cat double income byte income_quartiles 9 0 1 0 0 10.546 26.6365903358909 1 75 3 11 0 0 0 0 34.943 26.33688587358758 1 59 2 13 1 0 0 0 2.834 23.171812946223962 0 53.5 1 15 1 0 0 0 17.532 24.960095368077482 0 64.5 2 33 0 1 0 0 1.418 26.17530695456667 1 60 2 36 0 0 0 0 48.033 26.86812459610563 1 64 2 43 0 2 0 0 16.706 28.850875999733052 1 89 4 47 0 0 0 0 24.999 22.02641852754293 0 39 1 50 0 0 0 0 24.999 22.78547072959178 0 78 4 56 0 0 1 0 3.869 24.965775644983125 0 63 2 63 0 1 1 0 7.732 29.52430847817645 1 36 1 66 1 1 0 0 5.2105 27.601385355995284 1 95.5 4 70 0 1 0 0 15.444 28.20856646555208 1 51 1 77 0 2 0 0 4.085 26.69471565374245 1 65 2 80 0 0 0 0 17.333 28.967617641364775 1 47 1 84 0 1 0 0 16.331 23.765405394717792 0 108 4 87 0 1 0 0 35.335 27.591393217926697 1 89 4 90 0 0 0 0 37.67 25.949986446108696 1 58 2 91 1 1 0 0 19.1865 24.79527934587675 0 90.5 4 94 0 1 0 0 22.697 29.284290621090683 1 76 3 109 0 0 0 0 50.776 29.6396336137035 1 74 3 111 0 0 0 0 37.495 24.26853923650965 0 49 1 114 0 0 0 0 30.738 23.02254705185942 0 72 3 116 0 0 0 0 48.654 25.51933961395623 1 56 2 118 0 0 0 0 33.024 25.570099081052152 1 65 2 120 0 0 0 0 36.668 27.246295948390504 1 74 3 122 0 2 0 0 27.992 26.555117034315536 1 72 3 124 0 2 0 0 27.789 25.259106173207545 0 83 4 128 1 1 0 0 3.2525 23.802624487535013 0 73.5 3 129 1 1 0 0 5.67 25.277288385082883 0 89.5 4 end label values divorce Black label values Black_hus Black label values race_diff Black label def Black 0 "No", modify label def Black 1 "Yes", modify label values educ_hus educ_hus label def educ_hus 0 "<12 years", modify label def educ_hus 1 "12-15 years", modify label def educ_hus 2 "16+ years", modify label values age_cat age label def age 0 "25 and under", modify label def age 1 "Over 25", modify
Code:
stset marriage_dur, failure(divorce) id(id)
-Meghan