Announcement

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

  • Using restricted splines and modelling differences in surgical experience

    Research question: Trying to plot a graph to show the difference in outcomes of surgeons in MESH surgery. The number of cases is valued as surgical experience.
    I have found a nonlinear relationship so I have used - mkspline - restricted spline.

    Code:
    //Create spline 
    local knots_list 4 10 
    mkspline restrictedspline =yearlymesh, knot(`knots_list') cubic
    
    //This creates 1 knot which is = yearlymesh
    assert float(yearlymesh) == float(restrictedspline1) //confirms same variable 
    
    //I can either categorise into groups 
    
    gen volgrp = . 
    replace volgrp = 1 if yearlymesh <4
    replace volgrp = 2 if yearlymesh >=4 & yearlymesh <10 
    replace volgrp = 3 if yearlymesh >=10 
    
    //pERFORM a cox regression to see if hazard rate increases with increasing experience
    stcox restrictedspline1 covar1 covar2 covar3
    PROBLEM:

    With backward selection Volgrp got eliminated - i wasn't keen on categorising anyway

    I would like to plot a graph of hazards with different variable VolGrp
    Code:
    stcurve, hazard at1(volgrp=1) at 2(volgrp=2)
    However, volgrp was eliminated with backward selection, what are my alternatives here?
    Should I categorise restrictedspline1 with the same categories as volgrp?


    //I would like to assess if there are differences in the type of patients surgeons within different volume groups operate on

    Would you recommend using regress?

    Code:
    regress covar1 i.volgp




    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(mesh primaryconsultant revised gender) str4 operationid float(OpDate revisiondate opyear yearlyrevised yearlymesh)
    1 12 0 1 "2e"   16075     . 2004 1 2
    1 12 1 1 "1a"   16071 16437 2004 1 2
    1 13 1 2 "2a"   16834 16864 2006 1 2
    1 13 0 1 "4a"   17086     . 2006 1 2
    1 15 0 2 "6a"   17123     . 2006 0 1
    1 16 1 2 "5a"   17118 16928 2006 2 2
    1 16 1 1 "8a"   17154 18818 2006 2 2
    1 16 1 1 "10a"  17186 17918 2007 2 2
    1 16 1 1 "9a"   17185 20616 2007 2 2
    1 17 0 2 "135d" 17192     . 2007 0 1
    1 18 1 1 "143a" 17198 18322 2007 1 1
    1 19 0 2 "11a"  17209     . 2007 1 4
    1 19 0 2 "124e" 17211     . 2007 1 4
    1 19 0 1 "56a"  17214     . 2007 1 4
    1 19 1 2 "12e"  17212 21258 2007 1 4
    1 20 1 1 "12r"  17240 21655 2007 1 1
    1 21 0 2 "78r"  17272     . 2007 1 2
    1 21 1 2 "24d"  17303 18034 2007 1 2
    1 22 1 1 "980y" 17310 21328 2007 1 1
    1 23 0 2 "879r" 17331     . 2007 2 4
    end
    format %td OpDate
    format %td revisiondate
Working...
X