📄 simon_two_stage.m
字号:
%TITLE: SIMON'S TWO STAGE DESIGN%
%SOURCE OF FORMULA: P17, CHAPTER 4, STA 526:CLINICAL DESIGN%
%DESCRIPTION OF SIMON's Two Stage Design:%
%SIMON's two stage design is used to evaluate the activity of an
%experimental drug in Phase II clinical trial;usually, it consists of two
%stages as decscribed following:%
%Stage I: A total of N1 subjects are administered the intervention, and if
%R1 or less (R1<N1) of them respond, declare the intervention ineffective
%and the trial stops;otherwise, move the stage II%
%Stage II: Treat an additional N2 subjects;if in total at least R subjects
%response(i.e.,at least R-r1 respond in stage II), then the intervention is
%declared effective, otherwise declare ineffective%
%OBJECTIVE OF THE FUNCTION:%
%1)Caculate the probability of rejecting the drug%
%2)Calculate the probability of declaring a drug to be effective%
%INPUT VARIABLES%
%1)N1: Sample size on stage I%
%2)R1: Cutoff in stage I%
%3)N2: Sample szie on stage II%
%4)R: Cutoff for the entire trial if moved to stage II%
%5)PI_A:Actual response rate%
%OUTPUT VARIABLES%
%PORT: Probability of rejecting the experimental drug%
function PORT=simon_two_stage(N1,R1,N2,R,PI_A);%returns the probability of rejecting the treatment%
%Step1: Calculating PET on p17,Chapter 4%
c1=0
for k=0:R1;
c1=c1+1;
term1(c1)=nchoosek(N1,k)*(PI_A^k)*((1-PI_A)^(N1-k))
end
PET=sum(term1)
%step2: Calculating second term%
c2=0
for k=R1+1:min(N1,R)
c2=c2+1
first=nchoosek(N1,k)*(PI_A^k)*((1-PI_A)^(N1-k))
c3=0
for l=0:R-k;
c3=c3+1;
term2(c3)=nchoosek(N2,l)*(PI_A^l)*((1-PI_A)^(N2-l))
end
second=sum(term2)
term3(c2)=first*second;
end
second2=sum(term3)
%Step3: Calculating the probability of rejection%
PORT=PET+second2;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -