南方醫(yī)科大學(xué)生物統(tǒng)計(jì)學(xué)系(510515)
黃耀華 唐欣然 段重陽 陳平雁△
兩組率同為100%或0%時(shí)率差置信區(qū)間估計(jì)的SAS實(shí)現(xiàn)*
南方醫(yī)科大學(xué)生物統(tǒng)計(jì)學(xué)系(510515)
黃耀華 唐欣然 段重陽 陳平雁△
目的 通過SAS編程實(shí)現(xiàn)兩組事件發(fā)生率均為0%或100%時(shí)率差置信區(qū)間的估計(jì)。方法 針對事件發(fā)生率均為100%或0%時(shí)率差置信區(qū)間的估計(jì)問題,采用SAS9.4編程,使置信區(qū)間估計(jì)的Miettinen Nurminen法、Newcombe-Wilson法及校正Newcombe-Wilson法等三種方法得以實(shí)現(xiàn),并通過實(shí)例進(jìn)行說明。結(jié)果 所編程序?qū)崿F(xiàn)了三種方法的置信區(qū)間估計(jì),便于專業(yè)和非專業(yè)人員使用。實(shí)例中兩組樣本量分別為59,56,結(jié)果兩組事件發(fā)生率均為100%,三種方法的95%置信區(qū)間:Miettinen Nurminen法為[-6.16%,6.47%];Newcombe法為[-6.11%,6.42%];校正Newcombe法為[-7.62%,8.00%]。結(jié)論 本文所提供的SAS宏程序可以簡便地實(shí)現(xiàn)兩組事件發(fā)生率均為0%或100%時(shí)三種常用的率差置信區(qū)間的估計(jì)方法。
率差置信區(qū)間 SAS宏程序 Newcombe法 Miettinen Nurminen法
醫(yī)學(xué)研究領(lǐng)域,有時(shí)會遇到一種極端的結(jié)果,即兩個比較組的事件發(fā)生率均為100%或0%,如CT成像的優(yōu)良率、關(guān)節(jié)置換的成功率、使用腦膜貼片的腦脊液滲漏率等,此時(shí)兩組的率差為0。目前,常用的兩組事件發(fā)生率均為100%或0%時(shí)率差的置信區(qū)間估計(jì)方法有三種,分別是Miettinen Nurminen法[1]、Newcombe法和校正Newcombe法[2-4]。然而,最新版本的SAS軟件尚未提供上述三種方法的計(jì)算模塊,既不便于專業(yè)人員的操作,又阻礙了非專業(yè)人員的應(yīng)用。因此,本研究將編制SAS 9.4宏程序,為此種類型的數(shù)據(jù)處理提供方便可靠的工具。
1.Miettinen Nurminen法
若用x1、x2分別表示兩組的事件數(shù),p1、p2為兩組事件發(fā)生率,n1,n2分別為兩組樣本量,N=n1+n2為總樣本。對于率差θ,Miettinen Nurminen法[1]先構(gòu)建如下統(tǒng)計(jì)量:
其中
L0=x2θ(1-θ),L1=(n2θ-N-2x2)θ+x1+x2
L2=(n1+2n2)θ-N-x1-x2,L3=N
率差置信區(qū)間(L,U)分別為如下兩個等式的解:
L:TMN=-zα/2
U:TMN=zα/2
Newcombe[2]對上述算法重新表示為如下表達(dá)式:
2.Newcombe-Wilson法
Newcombe-Wilson方法已被FDA指南推薦,作為差置信區(qū)間計(jì)算方法的首選[2-5]。其計(jì)算方法是通過Wilson法分別得到兩單樣本率的可信區(qū)間上下限[3]。Wilson法單樣本率置信區(qū)間上下限為等式
式中q=1-p。Newcombe-Wilson法通過雜交方式構(gòu)建出率差置信區(qū)間上下限(L,U)如下:
其中l(wèi)1,u1,l2,u2分別為兩組率Wilson得分方法計(jì)算得到的置信區(qū)間上下限[2-4]。
3.校正Newcombe-Wilson法
連續(xù)校正Newcombe-Wilson得分方法相對較為保守[2-3],其率差計(jì)算公式雜交方法同Newcombe-Wilson得分方法,區(qū)別在于Wilson單組置信區(qū)間的計(jì)算公式有所調(diào)整,采用了連續(xù)性校正后的結(jié)果,具體計(jì)算公式為
連續(xù)校正方法因單組率計(jì)算的調(diào)整而增加可信區(qū)間的寬度,從而更加保守地估計(jì)組間差異[2-4]。
%macroratediff(n1=,n1_event=,n2=,n2_event=,alpha=,side=);
/* 近似正態(tài)方法1,此方法無法計(jì)算兩組率均100%率差,因此將兩組率保守設(shè)為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;
*率差置信區(qū)間下限;
l_diff=-(z**2*(a1+a3)/((a1+a3-1)*a1))/((z**2*(a1+a3)/((a1+a3-1)*a1))+1);
*率差置信區(qū)間上限;
u_diff=(z**2*(a1+a3)/((a1+a3-1)*a3))/((z**2*(a1+a3)/((a1+a3-1)*a3))+1);
run;
/*Newcombe-Wilson得分方法,提交FDA報(bào)告中常見的方法 */
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.);
*單樣本率置信區(qū)間下限;
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));
*單樣本率置信區(qū)間上限;
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;
單樣本率置信區(qū)間下限
l_diff=d-sqrt((p1-l1)**2+(u2-p2)**2);
單樣本率置信區(qū)間上限
u_diff=d+sqrt((p2-l2)**2+(u1-p1)**2);
run;
/*Newcombe-Wilson得分連續(xù)校正方法,所有計(jì)算方法中最保守 */
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.);
*單樣本率置信區(qū)間下限;
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));
*單樣本率置信區(qū)間上限;
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;
*率差置信區(qū)間下限;
l_diff=d-sqrt((p1-l1)**2+(u2-p2)**2);
*率差置信區(qū)間上限;
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=′近似正態(tài) (兩組率均為99.5%)′;
ifNewcombethenmethod=′Newcombe′;
ifNewcombeCCthenmethod=′Newcombe連續(xù)校正′;
l_diff=l_diff*100;
u_diff=u_diff*100;
run;
procprintdata=ratediff;
varmethodn1a1p1n2a3p2dl_diffu_diff;
formatl_diffu_diff8.2;
run;
%mend;
某項(xiàng)用于骨折患者的骨釘臨床試驗(yàn),由于產(chǎn)品技術(shù)成熟,所有隨訪到的受試者在最終的臨床評價(jià)中都為有效,即試驗(yàn)組和對照組事件發(fā)生率皆為100%。其中試驗(yàn)組有效例數(shù)為59,對照組有效例數(shù)為56,計(jì)算兩組事件發(fā)生率差值的點(diǎn)估計(jì)和置信區(qū)間估計(jì)。
該研究符合兩組率都為100%條件,可以調(diào)用之前所編寫程序,獲得三種方法下計(jì)算得到的率差的點(diǎn)估計(jì)和置信區(qū)間估計(jì)。
%ratediff(n1=59,n1_event=59,n2=56,n2_event=56,alpha=0.05,side=2);
表1為調(diào)用該宏程序后得到的結(jié)果,其中n1為試驗(yàn)組樣本量,a1為試驗(yàn)組有效的例數(shù),p1為試驗(yàn)組事件發(fā)生率,n2為對照組樣本量,a2為對照組有效的例數(shù),p2為對照組事件發(fā)生率,d為試驗(yàn)組和對照組兩組率差點(diǎn)估計(jì),l_diff和u_diff分別為率差置信區(qū)間的下限和上限。
三種方法算得的點(diǎn)估計(jì)都為0,MiettinenNurminen計(jì)算的率差置信區(qū)間估計(jì)為[-6.16%,6.47%];近似正態(tài)方法因無法估算兩組率差的置信區(qū)間,將兩組事件發(fā)生率保守估計(jì)為99.5%,獲得率差置信區(qū)間估計(jì)為[-2.58%,2.58%];Newcombe方法計(jì)算的率差置信區(qū)間估計(jì)為[-6.11%,6.42%];而Newcombe連續(xù)校正方法計(jì)算的率差置信區(qū)間估計(jì)為[-7.62%,8.00%]。
表1 調(diào)用%ratediff宏獲得三種方法下兩組率差點(diǎn)估計(jì)和置信區(qū)間估計(jì)
研究者可以根據(jù)試驗(yàn)預(yù)先設(shè)定的評價(jià)方法選擇恰當(dāng)?shù)囊环N,結(jié)合臨床和統(tǒng)計(jì)評價(jià)標(biāo)準(zhǔn)判斷試驗(yàn)研究假設(shè)是否成立。
率差置信區(qū)間估計(jì)最常用的方法是CMH(Cochran-Mantal Haenszel)法[5,9-11],但該法對于兩組率同為0%或100%的情況無法進(jìn)行置信區(qū)間估計(jì),應(yīng)用中雖然有將0%或100%用接近的數(shù)據(jù)替代(如0.5%或99.5%),但畢竟導(dǎo)致數(shù)據(jù)失真,不宜提倡。
從實(shí)例看,Miettinen Nurminen法和Newcombe法的結(jié)果相近,而校正Newcombe法的結(jié)果最為保守,且精度較差。關(guān)于這三種方法的統(tǒng)計(jì)性能究竟如何,尚有待我們進(jìn)一步的研究予以明確[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]張高魁. 陽性藥對照臨床試驗(yàn)有效性的可信區(qū)間評價(jià)方法. 中華臨床藥學(xué),2005,(5):389-391.
[10]劉沛. 總體率可信區(qū)間計(jì)算的一次近似法及其特征 . 中國衛(wèi)生統(tǒng)計(jì),2004,21(5):297-299.
[11]劉沛. 四種方法計(jì)算總體率可信區(qū)間的比較研究 . 中國衛(wèi)生統(tǒng)計(jì),2005,22(6):354-358.
(責(zé)任編輯:郭海強(qiáng))
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
*國家自然科學(xué)基金項(xiàng)目資助(81673270)
△通信作者:陳平雁,E-mail:chenpy99@126.com