



STATISTICAL RESOURCE 

Year : 2021  Volume
: 4
 Issue : 2  Page : 394397 

Basics of statistics  5: Sample size calculation (iii): A narrative review for the use of computer software, tables, and online calculators
HS Darling
Department of Medical Oncology and HematoOncology, Command Hospital Air Force, Bengaluru, Karnataka, India
Date of Submission  30Apr2021 
Date of Decision  15May2021 
Date of Acceptance  09Jun2021 
Date of Web Publication  30Jun2021 
Correspondence Address: H S Darling Department of Medical Oncology and HematoOncology, Command Hospital Air Force, Bengaluru  560 007, Karnataka, Karnataka India
Source of Support: None, Conflict of Interest: None
DOI: 10.4103/crst.crst_88_21
Sample size calculation is essential for every analytical study aiming to obtain evidencebased results. This review describes the basics of the use of computer software for sample size calculation with the help of a few simple hypothetical examples. Published studies reporting on sample size calculation were identified from the PubMed and MEDLINE databases. In addition, relevant books were reviewed. Of the 125 articles identified from the database search, five articles fulfilling the eligibility criteria were included in this narrative review. This article describes the appropriate sample size calculation approach to be used in different scenarios using examples mimicking realworld clinical situations. In addition, each example describes an alternate method for sample size calculation to verify the result for ease of understanding. This will enable the confirmation of the accuracy of the calculated sample size to avoid incorrect estimation. Overall, the use of computer software, tables, and online calculators makes sample size calculation convenient, accurate, flexible, and easily reproducible.
Keywords: Online calculators, sample size calculation, software, tables
How to cite this article: Darling H S. Basics of statistics  5: Sample size calculation (iii): A narrative review for the use of computer software, tables, and online calculators. Cancer Res Stat Treat 2021;4:3947 
How to cite this URL: Darling H S. Basics of statistics  5: Sample size calculation (iii): A narrative review for the use of computer software, tables, and online calculators. Cancer Res Stat Treat [serial online] 2021 [cited 2021 Jul 24];4:3947. Available from: https://www.crstonline.com/text.asp?2021/4/2/394/320224 
Introduction   
Besides being a complex task, sample size calculation entails enormous responsibility. There is an abundance of published literature available on sample size calculation. In the previous articles of the “sample size calculation” series published in earlier issues of the journal, various considerations for sample size calculation for different study designs have been described through the use of formulae.^{[1],[2]} However, this article is focused on the use of some computer software, tables, and online calculators for sample size calculation for various study designs. These methods are more convenient and user friendly than the formulabased methods of sample size calculation.
Methods   
A thorough search was performed to identify relevant published literature from various sources including the PubMed and MEDLINE databases. The search and selection process for articles is depicted in [Figure 1]. In addition to databases, books published on sample size calculation were reviewed. The abovementioned databases were searched using the terms “sample size,” “calculation,” “software,” and “tables.” A total of 125 articles were identified from the database search. After removing 13 duplicate records, a total of 112 articles were screened for eligibility for inclusion in this review. Finally, a total of 107 articles were excluded because of the content being not relevant to this manuscript, and five articles with relevant information and illustrations fulfilling the eligibility criteria were included in this review. The information extracted from the selected articles and books reviewed has been presented in a simplified format along with appropriate examples mimicking realworld clinical situations.  Figure 1: Sample size calculation using computer software, table, and online calculators.
Click here to view 
Tools for sample size calculation
A number of computer software are available for sample size calculation. A few of them are available free of cost and are reliable and user friendly. For the purpose of this review, the G * Power software (3.1.9.7 version) developed by HeinrichHeineUniversity, has been used for sample size calculation.^{[3]} In addition to software, many readytouse, simple online calculators are available for the estimation of sample size and other statistical parameters. Similarly, certain tables are available online as well as offline to facilitate sample size calculations across a range of values for different variables. Although the table method described in “Sample Sizes for Clinical, Laboratory, and Epidemiology Studies” by David Machin is the simplest to use, it requires the user to predefine the effect size and other parameters.^{[4]}
Comparing two proportions
The standard tests for comparing two proportions are the Chisquared test and the Fisher's exact test. Although Fisher's exact test is practically accurate only in the analysis of small samples (generally <10), it can also be used for larger sample sizes. The difference between the two tests is that the Chisquared test relies on an approximation, whereas Fisher's exact test is an exact test.^{[5]} Suppose we want to test a new drug for chemotherapyinduced nausea and vomiting, which can reduce the incidence rate from 20% to 5% in a toxic chemotherapeutic regimen. Let us assume a twotailed alpha (α) of 0.05 and 95% power.
Using the online calculator for sample size calculation with the Chisquared test, available at: https://samplesize.net/, the required sample size was estimated to be 274 with continuity correction and 248 without continuity correction.^{[6]} Similarly, another online calculator also estimated the sample size to be exactly the same at 248.^{[7]} In G * power, select “ztest” from the test family dropdown menu and select “Proportions: Difference between two independent proportions” from statistical tests. Fill in the following input parameters: Tails = 2, proportion p2 = 0.05, proportions p1 = 0.2, power = 0.95, and allocation ratio = 1. The estimated sample size is 248, which is exactly the same as that obtained using the Chisquared test above. Using “Exact test” and “Proportions: Inequality, two independent groups (Fisher's exact test),” as test family and statistical test inputs, respectively, the estimated sample size is 256.^{[3]}
Comparison with historical control
Suppose the prevalence of brain metastases in advanced stage small cell lung cancer is 15% over 3 months. Prophylactic cranial radiotherapy may reduce the occurrence to 10%. How many patients should be treated with prophylactic cranial radiotherapy to be 80% confident, with a twotailed α of 0.05, with equal group allocation?
In G * power, using “ztests” and “Proportions: difference between two independent proportions,” as the test family and statistical test inputs, respectively, the required total sample size is estimated to be 1372. With a onetailed α, the required total sample size is 1080.^{[3]} Similarly, using the table method, the total sample size is estimated to be exactly the same, i.e., 1372.^{4]}
Difference between two independent means
Suppose the use of prophylactic granulocyte colonystimulating factor reduces the number of hospital visits by 5, with a standard deviation of 7.5 for both arms. Assuming a twotailed α of 0.05 and 90% power, the total number of patients required is estimated to be 98, with 49 patients in each arm in G * power using “ttests” and “Means: Difference between two independent means (two groups)” as the test family and statistical test inputs, respectively. To calculate the effect size, any value can be used as an input for “mean group 1” and “mean group 2” such that the difference between the two means is 5. It can also be calculated as the difference in the means/standard deviation.^{[3]} With the table method, using the nearest possible effect size value, i.e. 0.65, the total sample size is estimated to be 102.^{[4]}
Difference of mean from constant
When planning a study where a group of patients is being compared to a historical control group, how many patients should be recruited in the experimental arm in the above example to show a reduction in the number of hospital visits by 5 in the experimental arm compared to the historical arm, with 90% confidence and a twotailed α of 0.05? In G * power, using “ttests” and “Means: Difference from constant (one sample case),” as the test family and statistical test inputs, respectively, the sample size is estimated to be 26.^{[3]} With the table method, using the nearest possible effect size value of 0.65, the total sample size is estimated to be 27.^{[4]}
Comparative studies – estimating binomial proportions (paired sample case)
In such studies, a matched pair design is used, in which patients are matched for age and clinical stage of the disease, where one patient in a matched pair is assigned to treatment A and the other to treatment B. Here, we make use of McNemar's test for correlated proportions, using the null hypothesis that out of the discordant pairs of outcomes, the proportion of each outcome is 50%. When H0 is P = ½ and H1 is P ≠ ½, pA is the probability that a discordant pair is from the treatment arm A, i. e., a member of the treatment arm A of the pair has the event, while the member of the treatment arm B of that pair does not have the event.^{[8]}
Suppose we want to compare surgical resection (treatment A) with stereotactic radiation therapy (treatment B) in a matched pair design trial for patients with lung cancer with solitary central nervous system metastases. The outcome measures are recurrence, progression, or death within a period of 6 months. Patients are matched on the basis of age group, histology, performance status, and comorbidities, where one patient in the matched pair is assigned to treatment A and the other to treatment B. Based on previous literature, it is estimated that, in 80% of the matched pairs, the two members will have concordant responses (i.e. both members of a pair will either die, progress, or show disease recurrence within 6 months or both will be alive with no disease progression or recurrence at 6 months), and in 20%, the responses will be discordant. In one out of three pairs with discordant responses, the patients assigned to treatment A will die, progress, or recur, whereas the patient assigned to treatment B will not. What is the estimated sample size with 80% power and a twotailed α of 0.05?
In G * power, using “Exact test” and “Proportions: Inequality, two dependent groups (McNemar)” as the test family and statistical test inputs, respectively, with an odds ratio of 2 (2/3 divided by 1/3), the estimated sample size is 360 pairs.^{[3]} Using the table method, the sample size is estimated to be 351 pairs.^{[4]}
Fteststatistical power and sample size for multiple regression
Logistic regression methods allow us to ascertain the association between the various forms of exposure (continuous or categorical) and a binary outcome variable, while also letting us control one or more confounding (categorical or continuous) variables. In linear regression, the calculated R value is the multiple correlation coefficient, which is a measure of the correlation between the observed and predicted values of the outcome variable. The value of R ranges between 0 and 1. The R squared (R^{2}) value is the coefficient of determination and indicates the percentage of the variance in the outcome variable that can be explained or accounted for by the explanatory variables. Hence, it is a measure of the “goodness of fit” of the regression line to the data. The required sample size increases with an increase in the number of predictor variables. Let us try to find out if body weight can be used to predict myelosuppression due to chemotherapy. Here, the null hypothesis is that there is no association between the body weight and myelosuppression. An R^{2} value of 0.50 indicates a modest relationship, where 50% of the variation in myelosuppression is explained by the body weight, assuming a normal distribution.^{[9]}
What is the required sample size to achieve 90% power for a multiple regression using eight independent variables, where R^{2 }=^{ }0.2, α =0.05? In G * power, using “F tests” and “Linear multiple regression: Fixed model, R^{2} deviation from zero,” as the test family and statistical test inputs, respectively, where the number of tested predictors is equal to the number of variables, and the effect size is equal to R^{2} in squared multiple correlation, the sample size is estimated to be 85.^{[3]} Similarly, using an online calculator, the required sample size is estimated to be 85, taking the effect size as 0.25.^{[10]}
Correlation of means
Suppose we want to know whether children with parents who have a high body mass index (BMI) tend to have a higher BMI as compared to the agematched standard population. For this, we need to calculate the Pearson's population correlation coefficient, α, the value of which ranges between +1 and −1. A value of +1 indicates a strong positive relationship, −1 indicates a strong negative relationship, and 0 indicates no relationship at all. Suppose, from the genetics estimates of the population, α is expected to be 0.5. What is the required sample size to confirm or refute this correlation with 90% power and a twotailed significance of 5%?
In G * power, using the ttest correlation point biserial model, the required sample size is estimated to be 34.^{[3]} Using the online calculator, the sample size is estimated to be 38.^{[11]}
Wilcoxon Rank Sum Test
This is a nonparametric analog of the ttest for two independent samples. It is also called the Mann–Whitney U test. Suppose the hospital records show that, during neoadjuvant chemotherapy, for patients with advanced ovarian cancer with massive ascites treated with standard chemotherapy plus bevacizumab, the average number of paracenteses is 2.5 with a standard deviation of 1.2, and for patients in the control group (chemotherapy without bevacizumab), the average number of paracenteses is 3.6 with a standard deviation of 1.9. With an allocation ratio of 1:1, twotailed α of 0.05, and assuming a normal distribution, how many participants are required in both the groups to prove the above hypothesis with 90% confidence?
In G * power, using “ttests” and “Means: WilcoxonMannWhitney test (two groups)” as the test family and statistical test inputs, respectively, the total sample size is estimated to be 94, with 47 patients in each group.^{[3]} Using the online calculator, the total sample size is estimated to be 100.^{[12]}
Sample size for beforeafter study (paired ttest)
A paired sample ttest is used when there are two sets of observations for each participant.^{[13]} Suppose we want to compare the pain score before and after 1 month of palliative radiation to the painful bone metastases. To calculate the sample size using G * power, with “ttests” and “Means: Wilcoxon signedrank test (matched pairs)” as the test family and statistical test inputs, respectively, we require the α, power, mean of difference, and standard deviation of the difference between pre and postradiation pain scores. Assuming a twotailed α of 0.05, power of 90%, mean of difference of 1.6, and standard deviation of the difference of 1.17, the estimated sample size is 9.^{[3]} Using an online software, the desired sample size is estimated to be 10.
Conclusion   
The use of computer software, online calculators, and tables for sample size calculation is feasible and convenient and produces reproducible results. Moreover, it is worthwhile to verify the accuracy of the estimated sample size using an alternate method to avoid errors in estimation. Nonetheless, small differences in the sample size estimates obtained using different methods are common.
Financial support and sponsorship
Nil.
Conflicts of interest
There are no conflicts of interest.
References   
1.  Darling HS. Basics of statistics – 4: Sample size calculation (ii): A narrative review. Cancer Res Stat Treat 2020;3:81728. [Full text] 
2.  Darling HS. Basics of statistics3: Sample size calculation – (i). Cancer Res Stat Treat 2020;3:31722. [Full text] 
3.  
4.  Machin D, Campbell MJ, Tan SB, Tan SH. Sample Sizes for Clinical, Laboratory and Epidemiology Studies. 4 ^{th} ed. New Jersey, US: Wiley Blackwell; 2018. 
5.  Peacock JL, Peacock PJ. Oxford Handbook of Medical Statistics. 1 ^{st} ed. Oxford, US: Oxford University Press; 2011. 
6.  
7.  
8.  Rosner B. Fundamentals of Biostatistics. 8 ^{th} ed. Oxford, US: Cengage Learning; 2015. 
9.  Barton B, Peat J. Medical Statistics: A Guide to SPSS, Data Analysis and Critical Appraisal. 2 ^{nd} ed. New Jersey, US: Wiley Blackwell; 2014. 
10.  
11.  
12.  
13.  
[Figure 1]
