[程式] SAS proc phreg與spline存活分析劑量關係圖已刪文

看板Statistics作者 (chusepoya)時間9年前 (2016/05/12 14:29), 9年前編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
提問-proc phreg與spline 不好意思請問大家 我想要將存活分析的HR畫出平滑化的劑量關係圖 ------------------------------------------------------------------------ proc phreg data=pop_variables; effect PMS = spline(mean / basis=tpf(noint) NATURALCUBIC details knotmetho d=list(13.31 47.2) ); model T*e(0)=PMS / rl=wald ties=EFRON ; store sasuser.coxr; run; %macro est(ref=0, start=13.31, end=47.2, by=1); %Do i = 1 %To %eval(%SysFunc( Ceil( %SysEvalF( ( &End - &Start ) / &By ) ) ) + 1) ; %Let value=%SysEvalF( ( &Start - &By ) + ( &By * &I ) ) ; estimate "&value." pms [-1, &ref] [1, &value] / exp cl; %end; %mend est; ods html select none; ods rtf select none; ods dataset Estimates=Estimates; proc plm restore=sasuser.coxr; %est(ref=0, start=13.31, end=47.2, by=1); run; ods html select all; ods rtf select all; data estimates; set estimates; PM=label*1; run; proc sgplot data=estimates NOAUTOLEGEND; Series y=ExpEstimate x=PM / ; Series y=LowerExp x=PM / LINEATTRS=(pattern=ShortDash color=Black THICKNES S=1); Series y=UpperExp x=PM / LINEATTRS=(pattern=ShortDash color=Black THICKNES S=1); yaxis Values=(1 1.1 1.2 1.3) Label="Hazard ratio" Type=LOG LABELATTRS=(wei ght=BOLD); xaxis min=13 VALUES=(13 to 50 by 5) LABELATTRS=(weight=BOLD); run; ------------------------------------------------------------------------------ - 在信賴區間部分會因為我設ref=0, start=13.31, end=47.2, by=1 而造成數值越大信賴區間差距越大的問題 想請問在code上如何修改? 另外如何針對校正因子修改model進行修改? 謝謝大家! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 39.8.206.33 ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1463034588.A.45B.html ※ 編輯: chusepoya (39.8.206.33), 05/12/2016 14:32:01
文章代碼(AID): #1ND2BSHR (Statistics)