南方醫科大學生物統計學系(510515)
黃耀華 唐欣然 段重陽 陳平雁△
兩組率同為100%或0%時率差置信區間估計的SAS實現*
南方醫科大學生物統計學系(510515)
黃耀華 唐欣然 段重陽 陳平雁△
目的 通過SAS編程實現兩組事件發生率均為0%或100%時率差置信區間的估計。方法 針對事件發生率均為100%或0%時率差置信區間的估計問題,采用SAS9.4編程,使置信區間估計的Miettinen Nurminen法、Newcombe-Wilson法及校正Newcombe-Wilson法等三種方法得以實現,并通過實例進行說明。結果 所編程序實現了三種方法的置信區間估計,便于專業和非專業人員使用。實例中兩組樣本量分別為59,56,結果兩組事件發生率均為100%,三種方法的95%置信區間:Miettinen Nurminen法為[-6.16%,6.47%];Newcombe法為[-6.11%,6.42%];校正Newcombe法為[-7.62%,8.00%]。結論 本文所提供的SAS宏程序可以簡便地實現兩組事件發生率均為0%或100%時三種常用的率差置信區間的估計方法。
率差置信區間 SAS宏程序 Newcombe法 Miettinen Nurminen法
醫學研究領域,有時會遇到一種極端的結果,即兩個比較組的事件發生率均為100%或0%,如CT成像的優良率、關節置換的成功率、使用腦膜貼片的腦脊液滲漏率等,此時兩組的率差為0。目前,常用的兩組事件發生率均為100%或0%時率差的置信區間估計方法有三種,分別是Miettinen Nurminen法[1]、Newcombe法和校正Newcombe法[2-4]。然而,最新版本的SAS軟件尚未提供上述三種方法的計算模塊,既不便于專業人員的操作,又阻礙了非專業人員的應用。因此,本研究將編制SAS 9.4宏程序,為此種類型的數據處理提供方便可靠的工具。
1.Miettinen Nurminen法
若用x1、x2分別表示兩組的事件數,p1、p2為兩組事件發生率,n1,n2分別為兩組樣本量,N=n1+n2為總樣本。對于率差θ,Miettinen Nurminen法[1]先構建如下統計量:
其中
L0=x2θ(1-θ),L1=(n2θ-N-2x2)θ+x1+x2
L2=(n1+2n2)θ-N-x1-x2,L3=N
率差置信區間(L,U)分別為如下兩個等式的解:
L:TMN=-zα/2
U:TMN=zα/2
Newcombe[2]對上述算法重新表示為如下表達式:
2.Newcombe-Wilson法
Newcombe-Wilson方法已被FDA指南推薦,作為差置信區間計算方法的首選[2-5]。其計算方法是通過Wilson法分別得到兩單樣本率的可信區間上下限[3]。Wilson法單樣本率置信區間上下限為等式
式中q=1-p。Newcombe-Wilson法通過雜交方式構建出率差置信區間上下限(L,U)如下:
其中l1,u1,l2,u2分別為兩組率Wilson得分方法計算得到的置信區間上下限[2-4]。
3.校正Newcombe-Wilson法
連續校正Newcombe-Wilson得分方法相對較為保守[2-3],其率差計算公式雜交方法同Newcombe-Wilson得分方法,區別在于Wilson單組置信區間的計算公式有所調整,采用了連續性校正后的結果,具體計算公式為
連續校正方法因單組率計算的調整而增加可信區間的寬度,從而更加保守地估計組間差異[2-4]。
%macroratediff(n1=,n1_event=,n2=,n2_event=,alpha=,side=);
/* 近似正態方法1,此方法無法計算兩組率均100%率差,因此將兩組率保守設為99% */
dataCMHChisq;
n1=&n1.;p1=0.995;
n2=&n2.;p2=0.995;
d=p1-p2;
l_diff=d-probit(1-&alpha./&side.)*sqrt(p1*(1-p1)/n1+p2*(1-p2)/n2);
u_diff=d+probit(1-&alpha./&side.)*sqrt(p1*(1-p1)/n1+p2*(1-p2)/n2);
run;
/*MiettinenNurminen方法*/
datamienur;
n1=&n1.;a1=&n1_event.;a2=n1-a1;p1=a1/n1;
n2=&n2.;a3=&n2_event.;a4=n2-a3;p2=a3/n2;
z=probit(1-&alpha./&side.);
d=p1-p2;
*率差置信區間下限;
l_diff=-(z**2*(a1+a3)/((a1+a3-1)*a1))/((z**2*(a1+a3)/((a1+a3-1)*a1))+1);
*率差置信區間上限;
u_diff=(z**2*(a1+a3)/((a1+a3-1)*a3))/((z**2*(a1+a3)/((a1+a3-1)*a3))+1);
run;
/*Newcombe-Wilson得分方法,提交FDA報告中常見的方法 */
dataNewcombe;
n1=&n1.;a1=&n1_event.;a2=n1-a1;p1=a1/n1;
n2=&n2.;a3=&n2_event.;a4=n2-a3;p2=a3/n2;
z=probit(1-&alpha./&side.);
*單樣本率置信區間下限;
l1=(2*a1+z**2-z*sqrt(z**2+4*a1*a2/n1))/(2*(n1+z**2));
l2=(2*a3+z**2-z*sqrt(z**2+4*a3*a4/n2))/(2*(n2+z**2));
*單樣本率置信區間上限;
u1=(2*a1+z**2+z*sqrt(z**2+4*a1*a2/n1))/(2*(n1+z**2));
u2=(2*a3+z**2+z*sqrt(z**2+4*a3*a4/n2))/(2*(n2+z**2));
d=p1-p2;
單樣本率置信區間下限
l_diff=d-sqrt((p1-l1)**2+(u2-p2)**2);
單樣本率置信區間上限
u_diff=d+sqrt((p2-l2)**2+(u1-p1)**2);
run;
/*Newcombe-Wilson得分連續校正方法,所有計算方法中最保守 */
dataNewcombeCC;
n1=&n1.;a1=&n1_event.;a2=n1-a1;p1=a1/n1;
n2=&n2.;a3=&n2_event.;a4=n2-a3;p2=a3/n2;
z=probit(1-&alpha./&side.);
*單樣本率置信區間下限;
l1=(2*a1+z**2-1-z*sqrt(z**2-2-1/n1+4*p1*(n1*a2/n1+1)))/(2*(n1+z**2));
l2=(2*a3+z**2-1-z*sqrt(z**2-2-1/n2+4*p2*(n2*a4/n2+1)))/(2*(n2+z**2));
*單樣本率置信區間上限;
u1=(2*a1+z**2+1+z*sqrt(z**2+2-1/n1+4*p1*(n1*a2/n1-1)))/(2*(n1+z**2));
u2=(2*a3+z**2+1+z*sqrt(z**2+2-1/n2+4*p2*(n2*a4/n2-1)))/(2*(n2+z**2));
d=p1-p2;
*率差置信區間下限;
l_diff=d-sqrt((p1-l1)**2+(u2-p2)**2);
*率差置信區間上限;
u_diff=d+sqrt((p2-l2)**2+(u1-p1)**2);
run;
dataratediff;
lengthmethod$ 200;
setmienur(in=mienur)CMHChisq(in=CMHChisq)
Newcombe(in=Newcombe)NewcombeCC(in=NewcombeCC);
ifmienurthenmethod=′MiettinenNurminen(僅限兩組均為100%)′;
ifCMHChisqthenmethod=′近似正態 (兩組率均為99.5%)′;
ifNewcombethenmethod=′Newcombe′;
ifNewcombeCCthenmethod=′Newcombe連續校正′;
l_diff=l_diff*100;
u_diff=u_diff*100;
run;
procprintdata=ratediff;
varmethodn1a1p1n2a3p2dl_diffu_diff;
formatl_diffu_diff8.2;
run;
%mend;
某項用于骨折患者的骨釘臨床試驗,由于產品技術成熟,所有隨訪到的受試者在最終的臨床評價中都為有效,即試驗組和對照組事件發生率皆為100%。其中試驗組有效例數為59,對照組有效例數為56,計算兩組事件發生率差值的點估計和置信區間估計。
該研究符合兩組率都為100%條件,可以調用之前所編寫程序,獲得三種方法下計算得到的率差的點估計和置信區間估計。
%ratediff(n1=59,n1_event=59,n2=56,n2_event=56,alpha=0.05,side=2);
表1為調用該宏程序后得到的結果,其中n1為試驗組樣本量,a1為試驗組有效的例數,p1為試驗組事件發生率,n2為對照組樣本量,a2為對照組有效的例數,p2為對照組事件發生率,d為試驗組和對照組兩組率差點估計,l_diff和u_diff分別為率差置信區間的下限和上限。
三種方法算得的點估計都為0,MiettinenNurminen計算的率差置信區間估計為[-6.16%,6.47%];近似正態方法因無法估算兩組率差的置信區間,將兩組事件發生率保守估計為99.5%,獲得率差置信區間估計為[-2.58%,2.58%];Newcombe方法計算的率差置信區間估計為[-6.11%,6.42%];而Newcombe連續校正方法計算的率差置信區間估計為[-7.62%,8.00%]。
表1 調用%ratediff宏獲得三種方法下兩組率差點估計和置信區間估計
研究者可以根據試驗預先設定的評價方法選擇恰當的一種,結合臨床和統計評價標準判斷試驗研究假設是否成立。
率差置信區間估計最常用的方法是CMH(Cochran-Mantal Haenszel)法[5,9-11],但該法對于兩組率同為0%或100%的情況無法進行置信區間估計,應用中雖然有將0%或100%用接近的數據替代(如0.5%或99.5%),但畢竟導致數據失真,不宜提倡。
從實例看,Miettinen Nurminen法和Newcombe法的結果相近,而校正Newcombe法的結果最為保守,且精度較差。關于這三種方法的統計性能究竟如何,尚有待我們進一步的研究予以明確[9-11]。
[1]Miettinen O,Nurminen M. Comparative analysis of two rates Stat Med,1985,4(2):213-226.
[2]Newcombe RG. Interval estimation for the difference between independent proportions:comparison of eleven methods . Stat Med,1998,17(8):873-890.
[3]Newcombe RG. Improved confidence intervals for the difference between binomial prportions based on paired data.Statist . Stat Med,1998,17(6):2635-2650.
[4]Newcombe RG. Two-sided confidence intervals for the single proportion:comparison of seven methods . Stat Med,1998,17(8):857-872.
[5]FDA. Guidance for Industry and FDA Staff - Statistical Guidance on Reporting Results from Studies Evaluating Diagnostic Tests.(2007-03-13)http://www.fda.gov/medicaldevices/deviceregulationandguidance/guidancedocuments/ucm071148.htm
[6]SAS Institute Inc. SAS/IML?9.2User’s Guide.Second Edition. Cary,North Carolina,USA:SAS Institute Inc,2009.
[7]Barker N. A Practical Introduction to the Bootstrap Using the SAS System.Heidelberg,2005.
[8]Mehrotra D,Railkar R. Minimum risk weights for comparing treatments in stratified binomial trials. Statistics in Medicine,2000,19:811-825.
[9]張高魁. 陽性藥對照臨床試驗有效性的可信區間評價方法. 中華臨床藥學,2005,(5):389-391.
[10]劉沛. 總體率可信區間計算的一次近似法及其特征 . 中國衛生統計,2004,21(5):297-299.
[11]劉沛. 四種方法計算總體率可信區間的比較研究 . 中國衛生統計,2005,22(6):354-358.
(責任編輯:郭海強)
SAS Implements of Calculating Rate Differences Confidence Intervals in Clinical Trials with Rates of 0% or 100% in Both Groups
Huang Yaohua,Tang Xinran,Duan Chongyang,et al
(BiometricsDepartment,SchoolofPublicHealthandTropicalMedicine,SouthMedicalUniversity(510515),Guangzhou)
Objective To estimate confidence intervals of clinical trials with success rates of 0% or 100% in both treatment and controlled groups using SAS programming.Methods To resolve the issue of calculating confidence intervals of rate differences in clinical trials with both rates of 0% or 100%,programs were drafted using SAS 9.4. Miettinen and Nurminen,Newcombe-Wilson Score and Continuity-corrected Newcombe-Wilson methods could all be implemented with these programs. In addition,one example was displayed to illustrate the convenience of the programs.Results Confidence intervals in trials with both success rates of 0% or 100% could be resolved using the 3 methods,and it can be used feasibly by professionals and non-professionals. In the given example,with sample size of 59,56,both of two groups had the success rate of 100%. 95%CI of rate difference was [-6.16%,6.47%] calculated by Miettinen Nurminen,[-6.11%,6.42%] by Newcombe-Wilson Score and [-7.62%,8.00%] by Continuity-corrected Newcombe-Wilson Score.Conclusion Miettinen and Nurminen,Newcombe-Wilson Score and Continuity-corrected Newcombe-Wilson methods could all be implemented easily to calculate confidence intervals of rate differences in clinical trials with both rates of 0% or 100% by invoking the developed programs.
Proportion difference confidence interval;SAS macro procedure;Newcome-Wilson score;Miettinen Nurminen
*國家自然科學基金項目資助(81673270)
△通信作者:陳平雁,E-mail:chenpy99@126.com