临床试验非劣效试验的样本量模拟计算SAS宏,以及PASS计算结果对比

2014-03-10 MedSci MedSci原创

例: 一种足癣标准治疗方案, 疗程结束时的真菌学清除率为80%。现提出一种相对简单的治疗方案, 为考察对比新方案与标准治疗方案的疗效, 拟设计一个非劣效性试验, 临床提出新方案的疗效达到标准方案清除率的90% 作为临床非劣效的相对标准, 即: 当新方案与标准方案在疗程末的真菌学相对清除率( 新方案P标准方案) 的95% 可信区间下限不低于0. 9时, 即可判断其临床非劣效于标准方案

例: 一种足癣标准治疗方案, 疗程结束时的真菌学清除率为80%。现提出一种相对简单的治疗方案, 为考察对比新方案与标准治疗方案的疗效, 拟设计一个非劣效性试验, 临床提出新方案的疗效达到标准方案清除率的90% 作为临床非劣效的相对标准, 即: 当新方案与标准方案在疗程末的真菌学相对清除率( 新方案P标准方案) 的95% 可信区间下限不低于0. 9时, 即可判断其临床非劣效于标准方案。问题: ( 1) 、病例为100 对, 检验的效能是多少? ( 2) 、要使效能达到0. 8, 需要多少病例?
问题(1)解决的SAS宏如下,运行没有问题。

%macro RR(delta,n1,n2,distr1,distr2,essai,report=1);
%global pow;                       
data _null_;         
     call symput("seed ",date());
  run;
  Data depart;
    do numessai=1 to &essai;
       do pat=1 to %eval(&n1+&n2);
          if pat<=&n1 then do;
          Distr=rantbl(&seed,&distr1);
          group=1;
          end ;
        if pat> %eval(&n1) and pat <= %eval(&n1+&n2) then do;
           Distr=rantbl(&seed,&distr2);
           group=2;
        end;
      output;
      end;
     end;
   Run;
/**对每组随机数进行CMH检验,并计算相对率;*/
proc freq data=depart(where=(group in (1,2))) noprint;
   by numessai;
   tables group * distr /cmh2 scores=ridit;
   output out=TRT_AB N lgrrc1;
run;
/** 计算达到非劣效标准的次数;*/
Data power1;
   set TRT_AB;
   if l_lgrrc1^=.;
   power=l_lgrrc1>=δ
   scenario="TRT-A/TRT-B";
Run;
proc univariate data=power1 noprint;
  by scenario;
  var power;
  output out =power2 n=n sum=rep;
run;
/** 计算效能,并准备报告;*/
Data power3;
  length distr1 distr2 30scenario 30 scenario  20;
  merge power2;
  by scenario;
  lcl=100-100*Betainv(0.975,n-rep+1,rep)+0;
  ucl=100*Betainv(0.975,rep+1,n-rep)+0;
  lC="["|| compress (put(lcl,best4.))||"%;"|| compress (put(ucl,best4.))||"%"||"]";
  distr1=compress(symget("distr1")*100||"%");
  distr2=compress(symget("distr2")*100||"%");
  n1=symget("n1");
  n2=symget("n2");
  delta=symget("delta");
  simul=symget("essai");
  power=100*rep/n;
  call symput('pow',put(power,best4.1));
Run;
/**当报告开关为'开'时,报告模拟结果;*/
%if  %eval(&report)=1 %then %do;
Title2"以相对率为指标时检验效能的计算结果";
Proc report data= power3 headline headskip nowindows split ="@" ls=120;
  column("--" scenario simul delta power lc  ("Expected sample size" "--" n1 n2)  ("Expected rates" "--" distr1 distr2));
define scenario /order format=$18. left width=18 "Scenario";
define simul/display format=$5.center width=12 "N of @ simulations";
define delta /display format=$5.center width=6"Delta";
define power/display format=4.1 center width=6"Power";
define lC/display format=$12.center width=12"95% cl of @ Power";
define n1/display format=$10.center width=12 "TRT-A";
define n2/display format=$10.center width=12 "TRT-B";
define distr1/display format=$12.center width=12 "TRT-A";
define distr2/display format=$12.center width=12 "TRT-B";
   compute after;
     line @31 108*"-";
   endcomp;
   footnote "seed=&seed";
%end;
Run;

%mend RR;

%RR(0.9, 100, 100, 0.80, 0.80, 1000);


%macro psize(delta,distr1,distr2,base=100,ratio=1,power=80,essai=1000,from=%STR(),to=%STR());
  options nodate nonumber ps=20;
  title;
  %if &from ne %then %goto fromto;
  %let n1=%eval(&base);
  %let n2=%eval(&n1*&ratio);
  %rr(&delta,&n1,&n2,&distr1,&distr2,&essai);
  %do %while(&pow < %eval(&power));
    %let step=%sysfunc(max(1,%sysfunc(int(%eval(&power)-&pow))));
    %let essai=%sysfunc(int(10000/%eval(&step)));
    %let n1=%eval(&n1+&step);
    %let n2=%eval(&n1+&ratio);
    %rr(&delta,&n1,&n2,&distr1,&distr2,&essai);
    %if &pow>= %eval(&power) %then %goto exit;
  %end;
  %do %while (&pow>%eval(&power));
    %let step=%sysfunc(max(1,%sysfunc(int(&pow-%eval(&power)))));
    %let essai= %sysfunc (int(10000/%eval (&step)));
    %let n1= %eval(&n1-&step);
    %let n2= %eval(&n1*&ratio);
    %rr(&delta,&n1, &n2,&distr1,&distr2,&essai);
    %if &pow <= %eval(&power) %then  %goto exit;
    %end;
  %fromto:
     %do t= %eval(&from-1) %to %eval(&to-1);
      %let n1=%eval(&t+1);
      %let n2=%eval(&n1*&ratio);
      %rr(&delta,&n1, &n2,&distr1,&distr2,&essai);
    %end;
  %exit:
  run;
  %mend psize;
  %psize (0.9,0.8,0.8);

当然,也可以采用PASS进行计算:
问题出现在“清除率的95%可信区间下限0.9”这里,在实际的临床试验中,不会知道这个下限的,仅知道非劣效界值,此值通常在5%~15%之间,不会超过15%,当然,界值约小需要样本量越多,比如某临床试验定了非劣效界值是15%,试验组及对照组的估计率是80%,这里的率95%可信区间下限不能等于80%-15%=65%。

如果本例中的“清除率的95%可信区间下限0.9”改为非劣效界值是15%,疗程结束时的真菌学清除率为80%,通过PASS计算得出每组样本量是112例。

版权声明:
本网站所有内容来源注明为“梅斯医学”或“MedSci原创”的文字、图片和音视频资料,版权均属于梅斯医学所有。非经授权,任何媒体、网站或个人不得转载,授权转载时须注明来源为“梅斯医学”。其它来源的文章系转载文章,或“梅斯号”自媒体发布的文章,仅系出于传递更多信息之目的,本站仅负责审核内容合规,其内容不代表本站立场,本站不负责内容的准确性和版权。如果存在侵权、或不希望被转载的媒体或个人可与我们联系,我们将立即进行删除处理。
在此留言
评论区 (4)
#插入话题
  1. [GetPortalCommentsPageByObjectIdResponse(id=1669327, encodeId=849e166932e34, content=<a href='/topic/show?id=9d7b620395d' target=_blank style='color:#2F92EE;'>#样本#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=22, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=62039, encryptionId=9d7b620395d, topicName=样本)], attachment=null, authenticateStatus=null, createdAvatar=null, createdBy=f33226554040, createdName=zhzhxiang, createdTime=Sun Sep 21 16:53:00 CST 2014, time=2014-09-21, status=1, ipAttribution=), GetPortalCommentsPageByObjectIdResponse(id=1907926, encodeId=aeaf190e926f3, content=<a href='/topic/show?id=b3c199328f2' target=_blank style='color:#2F92EE;'>#非劣效#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=39, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=99328, encryptionId=b3c199328f2, topicName=非劣效)], attachment=null, authenticateStatus=null, createdAvatar=, createdBy=ac1c235, createdName=tonychen21, createdTime=Tue May 20 02:53:00 CST 2014, time=2014-05-20, status=1, ipAttribution=), GetPortalCommentsPageByObjectIdResponse(id=2007761, encodeId=6f19200e76113, content=<a href='/topic/show?id=cf4d1590956' target=_blank style='color:#2F92EE;'>#SAS#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=24, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=15909, encryptionId=cf4d1590956, topicName=SAS)], attachment=null, authenticateStatus=null, createdAvatar=, createdBy=8e4c53, createdName=jiyangfei, createdTime=Mon Mar 24 18:53:00 CST 2014, time=2014-03-24, status=1, ipAttribution=), GetPortalCommentsPageByObjectIdResponse(id=1283468, encodeId=ef21128346865, content=<a href='/topic/show?id=302e6204212' target=_blank style='color:#2F92EE;'>#样本量#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=31, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=62042, encryptionId=302e6204212, topicName=样本量)], attachment=null, authenticateStatus=null, createdAvatar=, createdBy=b05b180, createdName=grace5700, createdTime=Wed Mar 12 13:53:00 CST 2014, time=2014-03-12, status=1, ipAttribution=)]
    2014-09-21 zhzhxiang
  2. [GetPortalCommentsPageByObjectIdResponse(id=1669327, encodeId=849e166932e34, content=<a href='/topic/show?id=9d7b620395d' target=_blank style='color:#2F92EE;'>#样本#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=22, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=62039, encryptionId=9d7b620395d, topicName=样本)], attachment=null, authenticateStatus=null, createdAvatar=null, createdBy=f33226554040, createdName=zhzhxiang, createdTime=Sun Sep 21 16:53:00 CST 2014, time=2014-09-21, status=1, ipAttribution=), GetPortalCommentsPageByObjectIdResponse(id=1907926, encodeId=aeaf190e926f3, content=<a href='/topic/show?id=b3c199328f2' target=_blank style='color:#2F92EE;'>#非劣效#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=39, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=99328, encryptionId=b3c199328f2, topicName=非劣效)], attachment=null, authenticateStatus=null, createdAvatar=, createdBy=ac1c235, createdName=tonychen21, createdTime=Tue May 20 02:53:00 CST 2014, time=2014-05-20, status=1, ipAttribution=), GetPortalCommentsPageByObjectIdResponse(id=2007761, encodeId=6f19200e76113, content=<a href='/topic/show?id=cf4d1590956' target=_blank style='color:#2F92EE;'>#SAS#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=24, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=15909, encryptionId=cf4d1590956, topicName=SAS)], attachment=null, authenticateStatus=null, createdAvatar=, createdBy=8e4c53, createdName=jiyangfei, createdTime=Mon Mar 24 18:53:00 CST 2014, time=2014-03-24, status=1, ipAttribution=), GetPortalCommentsPageByObjectIdResponse(id=1283468, encodeId=ef21128346865, content=<a href='/topic/show?id=302e6204212' target=_blank style='color:#2F92EE;'>#样本量#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=31, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=62042, encryptionId=302e6204212, topicName=样本量)], attachment=null, authenticateStatus=null, createdAvatar=, createdBy=b05b180, createdName=grace5700, createdTime=Wed Mar 12 13:53:00 CST 2014, time=2014-03-12, status=1, ipAttribution=)]
  3. [GetPortalCommentsPageByObjectIdResponse(id=1669327, encodeId=849e166932e34, content=<a href='/topic/show?id=9d7b620395d' target=_blank style='color:#2F92EE;'>#样本#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=22, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=62039, encryptionId=9d7b620395d, topicName=样本)], attachment=null, authenticateStatus=null, createdAvatar=null, createdBy=f33226554040, createdName=zhzhxiang, createdTime=Sun Sep 21 16:53:00 CST 2014, time=2014-09-21, status=1, ipAttribution=), GetPortalCommentsPageByObjectIdResponse(id=1907926, encodeId=aeaf190e926f3, content=<a href='/topic/show?id=b3c199328f2' target=_blank style='color:#2F92EE;'>#非劣效#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=39, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=99328, encryptionId=b3c199328f2, topicName=非劣效)], attachment=null, authenticateStatus=null, createdAvatar=, createdBy=ac1c235, createdName=tonychen21, createdTime=Tue May 20 02:53:00 CST 2014, time=2014-05-20, status=1, ipAttribution=), GetPortalCommentsPageByObjectIdResponse(id=2007761, encodeId=6f19200e76113, content=<a href='/topic/show?id=cf4d1590956' target=_blank style='color:#2F92EE;'>#SAS#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=24, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=15909, encryptionId=cf4d1590956, topicName=SAS)], attachment=null, authenticateStatus=null, createdAvatar=, createdBy=8e4c53, createdName=jiyangfei, createdTime=Mon Mar 24 18:53:00 CST 2014, time=2014-03-24, status=1, ipAttribution=), GetPortalCommentsPageByObjectIdResponse(id=1283468, encodeId=ef21128346865, content=<a href='/topic/show?id=302e6204212' target=_blank style='color:#2F92EE;'>#样本量#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=31, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=62042, encryptionId=302e6204212, topicName=样本量)], attachment=null, authenticateStatus=null, createdAvatar=, createdBy=b05b180, createdName=grace5700, createdTime=Wed Mar 12 13:53:00 CST 2014, time=2014-03-12, status=1, ipAttribution=)]
    2014-03-24 jiyangfei
  4. [GetPortalCommentsPageByObjectIdResponse(id=1669327, encodeId=849e166932e34, content=<a href='/topic/show?id=9d7b620395d' target=_blank style='color:#2F92EE;'>#样本#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=22, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=62039, encryptionId=9d7b620395d, topicName=样本)], attachment=null, authenticateStatus=null, createdAvatar=null, createdBy=f33226554040, createdName=zhzhxiang, createdTime=Sun Sep 21 16:53:00 CST 2014, time=2014-09-21, status=1, ipAttribution=), GetPortalCommentsPageByObjectIdResponse(id=1907926, encodeId=aeaf190e926f3, content=<a href='/topic/show?id=b3c199328f2' target=_blank style='color:#2F92EE;'>#非劣效#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=39, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=99328, encryptionId=b3c199328f2, topicName=非劣效)], attachment=null, authenticateStatus=null, createdAvatar=, createdBy=ac1c235, createdName=tonychen21, createdTime=Tue May 20 02:53:00 CST 2014, time=2014-05-20, status=1, ipAttribution=), GetPortalCommentsPageByObjectIdResponse(id=2007761, encodeId=6f19200e76113, content=<a href='/topic/show?id=cf4d1590956' target=_blank style='color:#2F92EE;'>#SAS#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=24, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=15909, encryptionId=cf4d1590956, topicName=SAS)], attachment=null, authenticateStatus=null, createdAvatar=, createdBy=8e4c53, createdName=jiyangfei, createdTime=Mon Mar 24 18:53:00 CST 2014, time=2014-03-24, status=1, ipAttribution=), GetPortalCommentsPageByObjectIdResponse(id=1283468, encodeId=ef21128346865, content=<a href='/topic/show?id=302e6204212' target=_blank style='color:#2F92EE;'>#样本量#</a>, beContent=null, objectType=article, channel=null, level=null, likeNumber=31, replyNumber=0, topicName=null, topicId=null, topicList=[TopicDto(id=62042, encryptionId=302e6204212, topicName=样本量)], attachment=null, authenticateStatus=null, createdAvatar=, createdBy=b05b180, createdName=grace5700, createdTime=Wed Mar 12 13:53:00 CST 2014, time=2014-03-12, status=1, ipAttribution=)]

相关资讯

样本量多大才具有代表性?

大部分从事临床科研和流行病学调查的朋友,都会碰到“多大样本量”才用代表性问题。那到底应该如何选择样本量呢?如何解释这样一个样本量是恰当或合适的,既满足统计要求,也能考虑费用和可操作性!                  &n