Updated Tuesday, September 26, 2017
JCIM & JIM
Open Access
THIS ARTICLE
-  Abstract
-  Full text
-  Download PDF file
-  Send to a friend
-  Related articles in JCIM & JIM
-  Cited in JCIM & JIM
-  Reader's comments
-  Send a comment
 Language Polishing
Methodology
Journal of Chinese Integrative Medicine: Volume 10, 2012   Issue 2
Estimation of sample size and testing power (Part 5)
1. Liang-ping Hu (Consulting Center of Biomedical Statistics, Academy of Military Medical Sciences, Beijing 100850, China E-mail: lphu812@sina.com)
2. Xiao-lei Bao (Consulting Center of Biomedical Statistics, Academy of Military Medical Sciences, Beijing 100850, China )
3. Xue Guan (Consulting Center of Biomedical Statistics, Academy of Military Medical Sciences, Beijing 100850, China )
4. Shi-guo Zhou (Consulting Center of Biomedical Statistics, Academy of Military Medical Sciences, Beijing 100850, China )
ABSTRACT: Estimation of sample size and testing power is an important component of research design. This article introduced methods for sample size and testing power estimation of difference test for quantitative and qualitative data with the single-group design, the paired design or the crossover design. To be specific, this article introduced formulas for sample size and testing power estimation of difference test for quantitative and qualitative data with the above three designs, the realization based on the formulas and the POWER procedure of SAS software and elaborated it with examples, which will benefit researchers for implementing the repetition principle.
KEYWORD: statistics, medical; research design; sample size; testing power; parametric estimation

Received December 2, 2011; accepted December 5, 2011; published online February 15, 2012.
Full-text LinkOut at PubMed. Journal title in PubMed: Zhong Xi Yi Jie He Xue Bao.

基金项目:国家科技重大专项“重大新药创制”资助项目 (No. 2009ZX09502-028)
Correspondence: Prof. Liang-ping Hu; Tel: 010-66931130; E-mail: lphu812@sina.com

  


     In this article, we will introduce the estimation of sample size and testing power of difference test for quantitative and qualitative data with the single-group design, the paired design or the crossover design.

 
  


1  Estimation of sample size and testing power of difference test for quantitative and qualitative data with the single-group design

     The single-group design refers to the research on the purpose to observe the value of a quantitative or qualitative index of a random sample under specific conditions. The single-group design only involves a specific level of an experimental factor, and the research subjects are not divided into groups based on any experimental factor or block factor. If the observational index is quantitative, the population mean or the standard value should be provided for hypothesis testing; if the observational index is qualitative, the population rate or the standard rate is needed[1].
1.1  Testing of the mean
1.1.1  Formulas for sample size estimation 
For one-sided test:



     For two-sided test:


     In formulas (1) and (2)[2], α and β are the allowed probabilities of making type Ⅰ error and type Ⅱ error, respectively; S represents the standard deviation; θ is the difference of the population means of the sample group and the standard group, which can be replaced by its estimated value if unknown; t1-α,df, t1-α/2,df and t1-β,df are the 1-α quantile, 1-α/2 quantile and 1-β quantile corresponding to the probability-density curve of the central t distribution with the degree of freedom df=n-1. The iterative algorithm is applied. First, let df=∞ and denote the n as n1; then let df=n1-1, and denote the n as n2 ... The process continues until the nearest two “n” are stable.
1.1.2  Formulas for testing power estimation  First, compute the value of t1-β,df by formulas (3) and (4)[2], then compute the value of 1-β accordingly, namely, the testing power.
    For one-sided test:



     For two-sided test:


     The symbols in formulas (3) and (4) have the same meanings as those in formulas (1) and (2).
1.1.3  Examples
1.1.3.1  Example 1 
The mean of the general closing time of the anterior fontanel of children in the northeast China is known as 14.1 months. A researcher planed to select a certain number of children with calcium deficiency in the northeast to survey whether the closing time of the anterior fontanel of the children in the northeast is longer. The pilot test showed that the closing time of the anterior fontanel of 36 children selected from the northeast was 14.3 months. and the standard deviation was 5.1 months. Suppose that the significance level α was set to be 0.05 and the testing power was required to be 75%. How many children were needed so that the researcher could draw the conclusion that the closing time of the anterior fontanel of the children in the northeast was longer?
     Analysis: Example 1 deals with the sample size estimation of the one-sided test for quantitative data with the single-group design. The sample mean, the standard mean, the sample standard deviation, the significance level and the testing power are all given. Formula (1) can be used for sample size estimation.
     The needed SAS program is as follows:
 

%let alpha=0.05;%let beta=0.25;%let miu_0=14.1;%let miu_1=14.3; %let s=5.1;%let side=1;
data a1;
theta=&miu_1-&miu_0;
if &side=1 then p1=1-αelse p1=1-&alpha/2; p2=1-β df=10**9;
t1=tinv(p1,df);t2=tinv(p2,df);
w=&s/theta; n1=((t1+t2)*w)**2;df=n1-1;
t1=tinv(p1,df); t2=tinv(p2,df);n2=((t1+t2)*w)**2;
do while(ABS(n1-n2)>1);
df=n2-1;n1=n2;t1=tinv(p1,df);t2=tinv(p2,df);
n2=((t1+t2)*w)**2;
end;
n=CEIL(MAX(n1,n2));file print;
if &side=1 then
PUT #3 @10 ' mean comparison of the single-group design (the one-sided test), the needed sample size' n=;
else
PUT #3 @10 ' mean comparison of the single-group design (the two-sided test), the needed sample size ' n=;
run;quit;


     Program explanation: In the beginning part, the six “%let” statements are used to specify the allowed probabilities of making type Ⅰ error and type Ⅱ error, the standard mean, the sample mean, the sample standard deviation and the one-sided test, which can be modified in specific situations.
     The output: The needed sample size n=3 500.
     Sometimes, the output of the program will be slightly different from the result of the manual computation, because the t value computed by the computer is more accurate than that from the t table.
     Below is the needed advanced SAS program:
 

proc power;
onesamplemeans test=t
sides=1 mean=0.2 stddev =5.1 ntotal =.power =0.75;
run;quit;


     Program explanation: The option “test=t” requires to conduct the t test to the mean; “sides=1” means to conduct the one-sided test; “mean=0.2” specifies the difference between the population mean corresponding to the sample and the standard mean; “stddev =5.1” specifies the sample standard value; “power = 0.75” specifies the testing power. The values in the program can be modified in specific situations.
     The output is that 3 500 children were needed.
1.1.3.2  Example 2  In example 1, suppose that the researcher used the data of the 36 children for the one-sided test instead of estimating the sample size, and drew the conclusion that there was no statistical significance between the population mean corresponding to the sample and the standard mean. Estimate the testing power.
     The needed program based on formula (3) is as follows:
 

%let miu_0=14.1; %let miu_1=14.3; %let n=36; %let s=5.1;
%let alpha=0.05;%let side=1;
data a2;
theta=&miu_1-&miu_0;
df=&n-1;
if &side=1 then p1=1-αelse p1=1-&alpha/2;
t_1_beta_df=theta*sqrt(&n)/&s-tinv(p1,df);
power=put(probt(t_1_beta_df,df),7.3);
if power<0.75 then do; sig='<0.75,';mean="the testing power is insufficient"; end;
if power>0.75 then do; sig='>=0.75,'; mean="the testing power is sufficient"; end ;
file print;
PUT #3 @15 ' power= ' power sig mean;
run;


     Program explanation: The six “%let” statements in the program specify the standard mean, the sample mean, the sample size, the sample standard deviation, the allowed probability of making type Ⅰ error and the one-sided test. The values in the program can be changed in specific situations.
     The output: Power=0.077<0.75, the testing power is insufficient.
     The needed advanced SAS program is as follows:
 

proc power;
onesamplemeans test=t
side=1 mean =0.2stddev =5.1 ntotal =36 power = .;
run;quit;


     Program explanation: The option “test=t” requires to conduct the t test to the mean; “sides=1” specifies the one-sided test; “mean=0.2” specifies the difference between the population mean corresponding to the sample and the standard mean; “stddev =5.1” refers to the sample standard deviation; “total = 36” specifies the sample size.
     The output: power=0.079<0.75. The testing power is insufficient.
     The result of the advanced SAS program is a little higher than that of the SAS program based on formulas (3) and (4) due to the fact that the advanced program adopted the approximate algorithm. The difference between the two algorithms is that the advanced program used the quantile of the standard normal distribution, while the other used the quantile of the t distribution. When the sample size is small, the result of the program based on formulas (3) and (4) is more accurate, while the result of the advanced program is slightly higher than the real value.
1.2  Testing of the rate
1.2.1  Formulas for sample size estimation 
For one-sided test:



     For two-sided test:


     In formulas (5) and (6)[2], p0 and p stand for the standard rate and the sample rate, respectively; θ stands for the difference of the population rates of the sample group and the standard group, which can be replaced by its estimated value if unknown; df=n-1. The iterative algorithm is also adopted for sample size estimation based on formulas (5) and (6). First, let df=∞ and denote the n as n1, then let df=n1-1 and denote the n as n2. The process continues until the nearest two “n” are stable.
1.2.2  Formulas for testing power estimation  First, compute the value of t1-β,df by formulas (7) and (8)[2], then compute the value of 1-β accordingly, namely, the testing power.
     For one-sided test:



     The symbols in formulas (7) and (8) have the same meanings as those in formulas (5) and (6).
1.2.3  Examples
1.2.3.1  Example 3 
According to the experience, the curative rate of traditional drug A in treatment of a certain disease is 60%. A researcher expected to test the curative rate of a new drug B. The pilot test showed that the curative rate of drug B was 75%. Suppose that the testing level α was 0.05 and the testing power was set to be 0.75. How many patients were needed in order to draw the conclusion that drug B was better than the traditional drug A?
     Analysis: Example 3 deals with the sample size estimation of the one-sided test for qualitative data with the single-group design. The known information includes the sample rate, the standard rate, the significance level and the testing power. Formula (5) can be adopted for sample size estimation.
     The SAS program based on formula (5) is as follows:
 

%let p=0.75;%let p0=0.60;%let theta=0.15;%let alpha=0.05;%let beta=0.25;%let side=1;
data a3;
df=10**9;
if &side=1 then do
n1=(((tinv(1-&alpha,df))*sqrt(&p0*(1-&p0))+(tinv(1-&beta,df))
*sqrt(&p*(1-&p)))/&theta)**2;
df=n1-1;
n2=(((tinv(1-&alpha,df))*sqrt(&p0*(1-&p0))+(tinv(1-&beta,df))
*sqrt(&p*(1-&p)))/&theta)**2;
do while(ABS(n1-n2)>1);
df=n2-1;n1=n2;
n2=(((tinv(1-&alpha,df))*sqrt(&p0*(1-&p0))+(tinv(1-&beta,df))
*sqrt(&p*(1-&p)))/&theta)**2;
end;end;
else do
n1=(((tinv(1-&alpha/2,df))*sqrt(&p0*(1-&p0))+(tinv(1-&beta,df))
*sqrt(&p*(1-&p)))/&theta)**2;
df=n1-1;
n2=(((tinv(1-&alpha/2,df))*sqrt(&p0*(1-&p0))+(tinv(1-&beta,df))
*sqrt(&p*(1-&p)))/&theta)**2;
do while(ABS(n1-n2)>1);
df=n2-1;n1=n2;
n2=(((tinv(1-&alpha/2,df))*sqrt(&p0*(1-&p0))+(tinv(1-&beta,df))
*sqrt(&p*(1-&p)))/&theta)**2;
end;end;
n=CEIL(MAX(n1,n2));
file print;
PUT #3 @15n 'patients were needed';
run;quit;


     Program explanation: The six “%let” statements in the program are used to set the sample rate, the standard rate, the rate difference, the probability of making type Ⅰ error, the probability of making type Ⅱ error and the one-sided test. In similar situations, readers only need to change the values of the parameters in the six “%let” statements to get the result.
     The output: Totally 56 patients were needed.
     There is no available advanced SAS program yet.
1.2.3.2  Example 4  In example 3, suppose that the researcher did not estimate the sample size. Instead, he performed the one-sided test using the data of the 50 patients and drew the conclusion that drug B was not better than the traditional drug A. Estimate the testing power.
     Below is the corresponding SAS program based on formula (7).

 

%let p=0.75;%let p0=0.60;%let theta=0.15;%let alpha=0.05;%let n=50; %let side=1;
data a4;
df=&n-1;
if &side=1 then p1=1-αelse p1=1-&alpha/2;
t_1_beta_df=(abs(&theta)*sqrt(&n)-tinv(p1,df)*sqrt(&p0*(1-&p0)))/sqrt(&p*(1-&p));
power=put(probt(t_1_beta_df,df),7.3);
if power<0.75 then do; sig='<0.75,';mean="the testing power is insufficient."; end;
if power>0.75 then do; sig='>=0.75,'; mean="the testing power is sufficient."; end ;
file print;
PUT #3 @15 'power= ' power sig mean;
run;


     Program explanation: The six “%let” statements are used to specify the sample rate, the standard rate, the rate difference, the probability of making type Ⅰ error, the probability of making type Ⅱ error and the one-sided test. In similar situations, readers only need to change the values of the parameters in the six “%let” statements to get the result.
     The output: power=0.709 < 0.75, the test power is insufficient.
     The needed advanced SAS program is as follows:
 

proc power;
onesamplefreq test=exact
nullproportion = 0.60
proportion = 0.75
sides = U
ntotal =50
power = .;
run;
proc power;
onesamplefreq test=adjz
nullproportion = 0.60
proportion = 0.75
sides = U
ntotal = 50
power = .;
run;
proc power;
onesamplefreq test=z
nullproportion = 0.60
proportion = 0.75
sides = U
ntotal = 50
power = .;
run;


     Program explanation: The option “test=exact | adjz | z”requires to proform the Fisher exact test or the adjusted Z test or the Z test; “sides=1” requires to conduct the one-sided test; “nullproportion =”and “proportion =” are used to set the standard rate and the sample rate; “sides = U | L | 1 | 2” requires to conduct the upper one-sided test, the lower one-sided test or the two-sided test, respectively; “ntotal=50” specifies the sample size; “power = .” means to estimate the testing power. The values of the parameters in the program can be altered in similar situations.
     The output of the first procedure: power=0.637<0.75. The testing power is insufficient.
     The output of the second procedure: power= 0.637<0.75. The testing power is insufficient.
     The output of the third procedure: power=0.748<0.75. The testing power is insufficient.
     The above three results are not exactly the same, and are slightly different from the result of the program based on formulas (7) and (8). The first two procedures have the same result, and are relatively conservative. The result of the third procedure may be slightly higher than the real value. The difference is caused by different hypothesis premise and different algorithms. When the sample size is small, the difference of the results of the above algorithms will be relatively larger. Therefore, the conservative result should be used. When the sample size is large, the results of the different algorithms will have slight difference. In that case, either algorithm is fine.

  


2  Estimation of sample size and testing power of difference test for quantitative and qualitative data with the paired design

     The paired design refers to the design of which only two levels of one experimental factor is involved and the data obtained are paired[1].
2.1  Testing of the mean
2.1.1  Formulas for sample size estimation 
In order to analyze the quantitative data of the paired design, first, calculate the difference of each pair, and then compare the mean of the difference and 0 using statistical method of quantitative data with the single-group design. Thus, the sample size estimation of the paired design is the same as that of the single-group design, except that θ in formulas (1) and (2) is changed into the mean of the sample difference, S is changed into the standard deviation of the sample difference and n is the number of the pairs.
2.1.2  Formulas for testing power estimation  The testing power estimation of quantitative data with the paired design is the same as that with the single-group design, except that S in formulas (3) and (4) is changed into the standard deviation of the sample difference, and n is changed into the number of the pairs.
2.1.3  Example  Since the formulas for sample size estimation and testing power estimation of quantitative data with the paired design is the same as that with the single-group design, we do not give examples in this part due to the space limit.
2.2  Testing of the rate
2.2.1  Formulas 
Below is the standard 2×2 table of the paired design[2]:
 

Method B Method A
+ -

+

a

b

-

c

d


Let 


2.2.2  Example 5  A certain kind of bacteria was inoculated in two mediums (A and B). The probability of A being positive and B being negative was π+-=0.04, and the probability of A being negative and B being positive was π-+=0.24. Suppose α=0.05 and β=0.10 and the two-sided test was required. How many pairs were needed?
     Analysis: Example 5 deals with the sample size estimation for qualitative data with the paired design having a binary responding variable. The inconsistent rates of the two methods and the probabilities of making type Ⅰ error and type Ⅱ error are given. The minimum number of the pairs is expected to estimate.
     The SAS program based on formula (9) is as follows:
 

%let alpha=0.05;%let beta=0.10;%let pi10=0.04;%let pi01=0.24;
data a5;
pi=(&pi10+&pi01)/2;
u1=PROBIT(1-&alpha/2);
u2=PROBIT(1-&beta);
n=CEIL(((u1*SQRT(2*pi)+u2*SQRT(2*&pi10*&pi01/pi))/(&pi10-&pi01))**2);
file print;
put #2 @15 'the needed number of pairs is ' n ' ';
run;quit;


     Program explanation: The four “%let” statements are used to specify the probabilities of making type Ⅰ error and type Ⅱ error and the probabilities of the two inconsistent rates. In similar situations, readers only need to alter the values of the parameters in the four “%let” statements to get the result.
     The output: The needed number of the pairs is 58.
     The needed advanced SAS program is as follows:

 

PROC POWER;
pairedfreq dist=NORMAL discpropdiff = 0.2 totalpropdisc = 0.28method=CONNORnpairs = . power = 0.90;
run;quit;
PROC POWER;
pairedfreq dist=NORMALdiscpropdiff = 0.2 totalpropdisc = 0.28
method=MIETTINENnpairs = .power = 0.90;
run;quit;


     Program explanation: The option “dist=NORMAL” specifies the normal distribution as the distribution of the testing statistics; “discpropdiff = 0.20” specifies the difference of the two inconsistent rates π-+ and π+-; “totalpropdisc = 0.28” stands for the sum of the two inconsistent rates π-+ and π+-; the options “method=CONNOR” and “method=MIETTINEN” specify the two different normal approximate algorithms (the results are slightly different).
     The output: The needed number of the pairs is 70 (based on the Connor method) or 61 (based on the Miettinen method).

  


3  Estimation of sample size and testing power of difference test for quantitative data with the two-stage crossover design

     The two-stage crossover design is adopted when there is a two-level experimental factor, and the researcher expects the two levels of the factor to be conducted on the same research subject in order. If the two levels of the experimental factor are performed on subjects that are paired according to similar conditions, it is called the paired two-stage crossover design. If the two levels of the experimental factor are performed on two groups of subjects, it is defined as the two-stage crossover design with two groups[1].
     The formulas for sample size estimation and testing power estimation for quantitative data with the single-group design, namely, formulas (1), (2), (3) and (4) can also be applied to the two-stage crossover design. Here, θ=x1-x2, x1 and x2 stand for the sample means of the two treatments, and S is the standard deviation of the difference of the two treatments[3].

  
References
1. Hu LP. The application of statistical triple-type theory in experimental designs[M]. Beijing: People’s Military Medical Press, 2006. 46, 48, 77. Chinese.
2. Hu LP. SAS research design and statistical analysis[M]. Beijing: People’s Medical Publishing House, 2010. 193, 219. Chinese.
3. Jin PH, Chen F. Medical statistics methods. 3rd ed[M]. Shanghai: Fudan University Press, 2009. 565. Chinese.
  
Reader's comments
1. ??????????????????????????????? (2016-3-26 0:00:00)
2. ????????????????????????? (2016-3-27 0:00:00)
3. ???e??e?????????????????? ????????????? http://cn.dongwonmall.com (2016-4-30 0:00:00)
4. Xn0G85 http://www.FyLitCl7Pf7kjQdDUOLQOuaxTXbj5iNG.com (2016-10-14 0:00:00)
5. Xn0G85 http://www.FyLitCl7Pf7kjQdDUOLQOuaxTXbj5iNG.com (2016-10-14 0:00:00)

Send a comment

 Home | Current Issue | Past Issues | SearchRSS
Copyright © 2013-2018 by JIM Editorial Office. All rights reserved. ISSN 2095-4964; CN 31-2083/R. 沪ICP备110264号