Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Data output from stratified stcox separating out the tables

    Hi not sure if anyone can help with Stratified cox model code. is it possible to generate an output similar to this textbook - ie. generating two different tables for interaction model (females) and males, allowing for interaction.

    Here's my code

    Code:
    //nO INTERACTION
    stcox rx logwbc,strata(gender)
    
    //iNTERACTION MODEL 
    gen gender_rx=gender*rx
    gen gender_wbc=gender*logwbc
    
    stcox rx logwbc gender_rx gender_wbc, strata(gender)
    The resulting table is:

    Click image for larger version

Name:	Screenshot 2023-07-19 at 17.28.41.png
Views:	1
Size:	40.4 KB
ID:	1721141


    When I would like it separated into gender categories like this book

    Click image for larger version

Name:	Screenshot 2023-07-19 at 17.29.21.png
Views:	1
Size:	96.4 KB
ID:	1721142


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int id byte(gender status) int survt byte rx int logwbc byte(_st _d) int _t byte _t0 double(skm schoen1 schoen2 schoen3 scaled1 scaled2 scaled3) float(clin_pr clin_do) byte _est_A float(gender_rx gender_wbc)
     1 1 1 428 0 50 1 1 428 0 .49487861711461295  -.4064125447024877   -8.20991658721669 -.18713556462504077 -1.1117045366842009    -.0791051775322178 -1.9633854560060229 0 50 1 0 50
     2 1 1 275 1 55 1 1 275 0  .6254575128891965   .5548509311940362 -2.6276198678555645 -.15839137562939976  2.8165035803281135   -.05907862224331886  -2.534907162116119 1 55 1 1 55
     3 1 1 262 0 55 1 1 262 0  .6323306723714954  -.4519726283315112 -2.5634275237316615   -.164515619933725 -1.4026712866967617   -.04403342248554185 -1.7860552811478838 0 55 1 0 55
     4 1 1 183 0 30 1 1 183 0  .7554674231699652  -.4872742468348428 -26.082175789549844 -.14575700368976396  -1.223578530746157   -.18714511234727876  -1.565349157004997 0 30 1 0 30
     5 1 1 259 1 65 1 1 259 0  .6460769913360932   .5431314388166606  7.3701360875516215 -.16304588051939617  2.6256612404343382  .0021374056120626594  -2.584729495857321 1 65 1 1 65
     6 1 1 714 0 55 1 1 714 0  .2007528219225352  -.5007387046495791  -8.534706397444744  -.2585127225445991 -1.4465200962950482   -.07952529577830643  -2.382684809008268 0 55 1 0 55
     7 1 1 438 1 65 1 1 438 0 .47965158274185565   .5810607549901932   6.607287790252599  -.1929035734265776  2.8193136812763497 -.0029909128632881476 -2.8192770541951466 1 65 1 1 65
     8 1 0 796 1 60 1 0 796 0  .1267912559510749                   .                   .                   .                   .                     .                   . 1 60 1 1 60
     9 1 1 892 0 50 1 1 892 0 .03622607312887855  -.2237086193889997 -15.908215991317263 -.34475231175811505   -.109550902323923   -.12833447455520447 -3.1779310002257692 0 50 1 0 50
    10 1 1 393 1 65 1 1 393 0   .517271314721609     .57375698786803   6.688734114127783 -.17709955120356713   2.775071345945274 -.0024298931875900084  -2.704304493400276 1 65 1 1 65
    11 1 0 161 1 80 1 0 161 0   .809257892691979                   .                   .                   .                   .                     .                   . 1 80 1 1 80
    12 1 1 836 1 60 1 1 836 0  .0869425755093085   .6294624154531419 -3.3432409589144285  -.3019733989822271   3.252726049493267   -.06414705528569396  -3.586005668926632 1 60 1 1 60
    13 1 1 523 0 55 1 1 523 0 .36599985793553974  -.4251017164416234  -4.393633584952077 -.22924435164130608 -1.2124744769593632  -.055423386397819296  -2.250545747424317 0 55 1 0 55
    14 1 1 612 0 70 1 1 612 0  .2747143878939956  -.4316447207748599   9.279170788081679 -.24238109180888512 -1.4283635053638932   .028175147215169206 -2.3730317193529347 0 70 1 0 70
    15 1 1 212 1 60 1 1 212 0  .7010622671944838   .5246170746582993   3.405360770923238 -.15532824487529373   2.599576074216523  -.021817840557064518  -2.506099839461203 1 60 1 1 60
    16 1 1 399 1 60 1 1 399 0  .5024921343009916   .5931082685875482  1.7733577978811113 -.18033239099215792   2.930238593900652   -.03270938702821573 -2.7287285061653463 1 60 1 1 60
    17 1 1 771 1 75 1 1 771 0  .1479231319429207   .4965841781087267   8.319809190190583  -.2191694510966422  2.4607329505030773   .008762000248839094  -2.939365324631048 1 75 1 1 75
    18 1 1 514 1 80 1 1 514 0  .4074209921360369   .5812079066775617   20.42759240386809 -.21260073397471646  2.6344987305852214    .08142839014198947 -2.9928510802400794 1 80 1 1 80
    19 1 1 512 0 80 1 1 512 0 .41556941197875763 -.41575475376511367  20.279438855941862 -.21105882181946356  -1.546254375056641     .0950133795617317 -2.1980899640359146 0 80 1 0 80
    21 1 1 624 1 80 1 1 624 0  .2641484498980727   .5718468247305328  19.537023560797223 -.26247782615078874   2.647388156851247     .0762615363202151 -3.3285254318083695 1 80 1 1 80
    end

  • #2
    Clyde Schechter Does this make sense?

    Comment

    Working...
    X