|Year : 2021 | Volume
| Issue : 2 | Page : 394-397
Basics of statistics - 5: Sample size calculation (iii): A narrative review for the use of computer software, tables, and online calculators
Department of Medical Oncology and Hemato-Oncology, Command Hospital Air Force, Bengaluru, Karnataka, India
|Date of Submission||30-Apr-2021|
|Date of Decision||15-May-2021|
|Date of Acceptance||09-Jun-2021|
|Date of Web Publication||30-Jun-2021|
H S Darling
Department of Medical Oncology and Hemato-Oncology, Command Hospital Air Force, Bengaluru - 560 007, Karnataka, Karnataka
Source of Support: None, Conflict of Interest: None
Sample size calculation is essential for every analytical study aiming to obtain evidence-based 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 real-world 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:394-7
|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:394-7. 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., 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 formula-based 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 above-mentioned 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 real-world 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 (22.214.171.124 version) developed by Heinrich-Heine-University, has been used for sample size calculation. In addition to software, many ready-to-use, 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.
Comparing two proportions
The standard tests for comparing two proportions are the Chi-squared 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 Chi-squared test relies on an approximation, whereas Fisher's exact test is an exact test. Suppose we want to test a new drug for chemotherapy-induced nausea and vomiting, which can reduce the incidence rate from 20% to 5% in a toxic chemotherapeutic regimen. Let us assume a two-tailed alpha (α) of 0.05 and 95% power.
Using the online calculator for sample size calculation with the Chi-squared test, available at: https://sample-size.net/, the required sample size was estimated to be 274 with continuity correction and 248 without continuity correction. Similarly, another online calculator also estimated the sample size to be exactly the same at 248. In G * power, select “z-test” from the test family drop-down 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 Chi-squared 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.
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 two-tailed α of 0.05, with equal group allocation?
In G * power, using “z-tests” 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 one-tailed α, the required total sample size is 1080. 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 colony-stimulating factor reduces the number of hospital visits by 5, with a standard deviation of 7.5 for both arms. Assuming a two-tailed α 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 “t-tests” 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. With the table method, using the nearest possible effect size value, i.e. 0.65, the total sample size is estimated to be 102.
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 two-tailed α of 0.05? In G * power, using “t-tests” 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. With the table method, using the nearest possible effect size value of 0.65, the total sample size is estimated to be 27.
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.
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 two-tailed α 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. Using the table method, the sample size is estimated to be 351 pairs.
F-test-statistical 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 (R2) 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 R2 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.
What is the required sample size to achieve 90% power for a multiple regression using eight independent variables, where R2 = 0.2, α =0.05? In G * power, using “F tests” and “Linear multiple regression: Fixed model, R2 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 R2 in squared multiple correlation, the sample size is estimated to be 85. Similarly, using an online calculator, the required sample size is estimated to be 85, taking the effect size as 0.25.
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 age-matched 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 two-tailed significance of 5%?
In G * power, using the t-test correlation point biserial model, the required sample size is estimated to be 34. Using the online calculator, the sample size is estimated to be 38.
Wilcoxon Rank Sum Test
This is a nonparametric analog of the t-test 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, two-tailed α 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 “t-tests” and “Means: Wilcoxon-Mann-Whitney 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. Using the online calculator, the total sample size is estimated to be 100.
Sample size for before-after study (paired t-test)
A paired sample t-test is used when there are two sets of observations for each participant. 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 “t-tests” and “Means: Wilcoxon signed-rank 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 post-radiation pain scores. Assuming a two-tailed α 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. 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
Conflicts of interest
There are no conflicts of interest.
| References|| |
Darling HS. Basics of statistics – 4: Sample size calculation (ii): A narrative review. Cancer Res Stat Treat 2020;3:817-28. [Full text]
Darling HS. Basics of statistics-3: Sample size calculation – (i). Cancer Res Stat Treat 2020;3:317-22. [Full text]
Machin D, Campbell MJ, Tan SB, Tan SH. Sample Sizes for Clinical, Laboratory and Epidemiology Studies. 4th
ed. New Jersey, US: Wiley Blackwell; 2018.
Peacock JL, Peacock PJ. Oxford Handbook of Medical Statistics. 1st
ed. Oxford, US: Oxford University Press; 2011.
Rosner B. Fundamentals of Biostatistics. 8th
ed. Oxford, US: Cengage Learning; 2015.
Barton B, Peat J. Medical Statistics: A Guide to SPSS, Data Analysis and Critical Appraisal. 2nd
ed. New Jersey, US: Wiley Blackwell; 2014.