SlideShare a Scribd company logo
1 of 29
Sample size: a couple more hints
to handle it right using SAS and R
Frankfurt 2018
Andrii Artemchuk, Kharkiv, Ukraine
Page 2
A clinical trial must be carefully planned to achieve
it’s objectives. Estimation of the sample size is an
important part of planning a clinical trial – and
usually a difficult one
Why is it needed?
Page 3
Balance is important
Too big Too small
Page 4
Methods of estimation
Confidence
intervals Bayesian
approach
Power
analysis
Page 5
• Level of significance
• Power of the criterion
• Data variability
• Least expected treatment effect
What affects the sample size
Page 6
• Level of significance
Sample size grows as the level of significance decreases,
as well as decreases the probability of making type I error, i.e.
probability of rejecting the tested hypothesis when it is correct. In
practice, it is assumed to be 0.05 or 0.01
• Power of the criterion
• Data variability
• Least expected treatment effect
What affects the sample size
Page 7
• Level of significance
• Power of the criterion
The higher it is, the more likely it is to detect differences
between the compared groups, and the greater statistical
significance of the test criterion is. The larger power of the
criterion is, the larger sample size is required
• Data variability
• Least expected treatment effect
What affects the sample size
Page 8
• Level of significance
• Power of the criterion
• Data variability
When estimating sample size, it is often necessary to know
the spread of the data, which is required to estimate the variance
or the standard deviation. The bigger they are the larger sample
size may be required
• Least expected treatment effect
What affects the sample size
Page 9
• Level of significance
• Power of the criterion
• Data variability
• Least expected treatment effect
Treatment effect is the magnitude of the clinical benefit of the
treatment, which is clinically important. It is often expressed
through the difference in statistics: for example, through the
difference between means, standard deviations or proportions
What affects the sample size
Page 10
Difficulties
Variability is unknown, as the
data has not been analyzed
The magnitude of treatment
effect is unknown before the
trial is conducted
Patients may be
non-compliant to their
treatment regimens
Patient’s data may not be
entered correctly, or patients
may be lost to follow-up
Page 11
Difficulties: Variability
• Use the data from similar published trials, from
literature or from a pilot study
• Estimate the known min and max values of a
parameter
• Estimate standard deviation as the difference
between the max and min known values of the
parameter, divided by 4
Page 12
Difficulties: Treatment effect
• Try to determine direction of the effect and define its min and
max values
• Consider several options for the possible effect, estimate the
sample size for each of them and choose the most optimal
one
• Find if it’s possible to allocate a budget for the inclusion of
several more patients, in order to observe the effect, that
can’t be seen at a current stage of a clinical trial
Page 13
Difficulties: Treatment effect (cont.)
• Assess whether the cost of including new patients is
worthwhile to detect a difference between groups if at the
current stage of a trial either the effect of the treatment is
already present, or there is no effect at all
• Do the opposite, and find out what effect will be unreasonable
for detection
Page 14
Difficulties: Non-compliance
Recalculate sample size to include non-compliant
patients in treatment and control groups
!"
=
!
(1 − '( − '))+
Page 15
Difficulties: Losses to follow-up
Recalculate sample size to add percent of
patients, that will not be included into the final
analysis because of incorrect data or loss to
follow-up
!"
=
!
1 − &
Page 16
• SAS: PROC POWER
• SAS: PROC GLMPOWER
• R: PWR package
• R: powerSurvEpi package
• User defined functions in SAS
Tools to estimate the sample size
Page 17
The effect of Vitamin D compared to placebo on the prevention
of neonatal hypocalcaemia is examined on pregnant women
MAIN EFFICACY PARAMETER Serum calcium level
MEAN 9.0mg/100ml
STANDARD DEV 1.8 mg/100ml
TREATMENT EFFECT Increase of 0.5 mg/100ml
POWER 95%
LEVEL OF SIGNIFICANCE 5%
1. PROC GLMPOWER in SAS:
difference between means
Page 18
1. PROC GLMPOWER in SAS:
difference between means
data oneway;
level = "a1";
meanest = 9; output;
level = "a2";
meanest = 9.5; output;
run;
proc glmpower data=oneway;
class level;
model meanest = level;
power
stddev = 1.8
alpha = 0.05
ntotal = .
power = .95;
run;
The SAS System
The GLMPOWER Procedure
Computed N Total
Error
DF
Actual
Power
N
Total
674 0.950 676
Page 19
2. PROC POWER in SAS:
time-to-event data
MAIN EFFICACY PARAMETER Risk of a heart attack
STUDY TIME 5 years
EVENT RATE IN CONTROL GROUP 20%
TREATMENT EFFECT Decrease of rate to 15%
POWER 80%
LEVEL OF SIGNIFICANCE 5%
The influence of HDL-Plus on the risk of a heart attack is studied. 20% of patients are
expected to suffer a heart attack over the course of the 5 years. Patients taking HDL-
Plus can expect their risk of a heart attack to decrease to approximately 15%
Page 20
2. PROC POWER in SAS:
time-to-event data
proc power;
twosamplesurvival
test = logrank
curve("Control") =(0 5):(1 0.8)
curve("Treatment")=(0 5):(1 0.85)
refsurvival = "Control"
accrualtime = 2.5
followuptime = 2.5
hazardratio = 1.373
alpha = 0.05
sides = 2
ntotal = .
power = 0.8;
run;
The SAS System
The POWER Procedure
Log-Rank Test for Two Survival Curves
Computed N Total
Actual
Power
N Total
0.800 1772
Page 21
Formula for estimation of sample size:
! =
1
$% + $'
( + 1
( − 1
*
(,-.
/
*
+ ,-.0)*
$' and $% are the probabilities of the event to happen of a patient in
treatment and control groups respectively during a trial.
( =
234(-.56)
234(-.57)
is a relative risk of the event occurrence, or hazard ratio.
3. User defined functions in SAS:
time-to-event data
Page 22
proc fcmp outlib = work.mysubs.myfunc;
function twosamplelogrank(piT, piC, alpha, power);
*Simple checks to make sure all parameters are valid;
if 0 ge piC ge 1 or 0 ge piT ge 1 then do;
put "%str(ER)ROR: check sample parameters input! Must be between 0 and 1!";
return;
end;
if 0 ge alpha ge 1 or 0 ge power ge 1 then do;
put "%str(ER)ROR: check parameters alpha and power input! Must be between 0
and 1!";
return;
end;
theta = log(1 - piC) / log(1 - piT);
N = ((theta + 1)**2)*(probit(1 - alpha/2) + probit(power))**2 / ( (piC +
piT)*(theta - 1)**2 );
return(ceil(N));
endsub;
run;
3. User defined functions in SAS:
time-to-event data
Page 23
3. User defined functions in SAS:
Page 24
4. PWR package in R:
difference between proportions
The efficacy of corticosteroid injections compared to physiotherapy in
treating a painful rigid shoulder is examined. Success means that 40% of
patients have a response in the group where treatment is less effective
MAIN EFFICACY PARAMETER Response to treatment
RATE IN TREATMENT GROUP 65%
RATE IN CONTROL GROUP 40%
TREATMENT EFFECT Difference of 25% between groups
POWER 80%
LEVEL OF SIGNIFICANCE 5%
Page 25
install.packages("pwr")
library(pwr)
effect <- ES.h(0.4, 0.65)
pwr.2p.test(h = effect,
n = NULL,
sig.level = 0.05,
power = 0.8,
alternative = "two.sided")
## Difference of proportion
## power calculation for
## binomial distribution
## (arcsine transformation)
##
## h = 0.5060506
## n = 61.29835
## sig.level = 0.05
## power = 0.8
## alternative = two.sided
##
## NOTE: same sample sizes
4. PWR package in R:
difference between proportions
Page 26
Do results match?
SAS R
PROC
GLMPOWER
PROC
POWER
PWR
package
powerSurvEpi
package
User defined
formulas
Difference in
means
676 676 676 - 674
Difference in
proportions
- 124 124 - 124
Time-to-event
data
- 1772 - Linear 1816
Linear 1816
Exp 1730
Page 27
PLAN: It is highly important to calculate the
required sample size before a clinical trial starts,
so that the trial will not become a waste of
resources.
All aspects of the trial design must be taken into
account for an accurate assessment
Conclusions
Page 28
ACT: Many resources are available, such as
procedures in SAS and R that may reflect the
clinical trial model in detail.
The variety of these resources may help to check
the results obtained
Conclusions
Andrii Artemchuk
andrii.artemchuk@intego-group.com
Kharkiv, Ukraine
www.intego-group.com
Thank you for your attention!

More Related Content

What's hot

Statistical package for the social sciences
Statistical package for the social sciencesStatistical package for the social sciences
Statistical package for the social sciencesRegent University
 
What is bayesian statistics and how is it different?
What is bayesian statistics and how is it different?What is bayesian statistics and how is it different?
What is bayesian statistics and how is it different?Wayne Lee
 
Organizaton chart of us fda.
Organizaton chart of us fda.Organizaton chart of us fda.
Organizaton chart of us fda.Rovil Goel
 
INCLUSION AND EXCLUSION CRITERIA session ACRM.pptx
INCLUSION AND EXCLUSION CRITERIA session ACRM.pptxINCLUSION AND EXCLUSION CRITERIA session ACRM.pptx
INCLUSION AND EXCLUSION CRITERIA session ACRM.pptxACSRM
 
Confidence intervals
Confidence intervalsConfidence intervals
Confidence intervalsTanay Tandon
 
Interim analysis in clinical trials (1)
Interim analysis in clinical trials (1)Interim analysis in clinical trials (1)
Interim analysis in clinical trials (1)ADITYA CHAKRABORTY
 
Practical Biostatistics for Clinical Trials: How to Find and Use Your Biostat...
Practical Biostatistics for Clinical Trials: How to Find and Use Your Biostat...Practical Biostatistics for Clinical Trials: How to Find and Use Your Biostat...
Practical Biostatistics for Clinical Trials: How to Find and Use Your Biostat...NAMSA
 
Understanding clinical trial's statistics
Understanding clinical trial's statisticsUnderstanding clinical trial's statistics
Understanding clinical trial's statisticsMagdy Khames Aly
 
RESEARCH METHODOLOGY
RESEARCH METHODOLOGYRESEARCH METHODOLOGY
RESEARCH METHODOLOGYBinuja S.S
 
Statistical tests of significance and Student`s T-Test
Statistical tests of significance and Student`s T-TestStatistical tests of significance and Student`s T-Test
Statistical tests of significance and Student`s T-TestVasundhraKakkar
 
Sample size calculation - a brief overview
Sample size calculation - a brief overviewSample size calculation - a brief overview
Sample size calculation - a brief overviewAzmi Mohd Tamil
 
3.1 non parametric test
3.1 non parametric test3.1 non parametric test
3.1 non parametric testShital Patil
 

What's hot (20)

Statistical package for the social sciences
Statistical package for the social sciencesStatistical package for the social sciences
Statistical package for the social sciences
 
What is bayesian statistics and how is it different?
What is bayesian statistics and how is it different?What is bayesian statistics and how is it different?
What is bayesian statistics and how is it different?
 
Statistical Power
Statistical PowerStatistical Power
Statistical Power
 
7 asmita gautam-journal-club-presentation
7 asmita gautam-journal-club-presentation7 asmita gautam-journal-club-presentation
7 asmita gautam-journal-club-presentation
 
Organizaton chart of us fda.
Organizaton chart of us fda.Organizaton chart of us fda.
Organizaton chart of us fda.
 
Introduction to statistical software R
Introduction to statistical software RIntroduction to statistical software R
Introduction to statistical software R
 
INCLUSION AND EXCLUSION CRITERIA session ACRM.pptx
INCLUSION AND EXCLUSION CRITERIA session ACRM.pptxINCLUSION AND EXCLUSION CRITERIA session ACRM.pptx
INCLUSION AND EXCLUSION CRITERIA session ACRM.pptx
 
Confidence intervals
Confidence intervalsConfidence intervals
Confidence intervals
 
Interim analysis in clinical trials (1)
Interim analysis in clinical trials (1)Interim analysis in clinical trials (1)
Interim analysis in clinical trials (1)
 
Practical Biostatistics for Clinical Trials: How to Find and Use Your Biostat...
Practical Biostatistics for Clinical Trials: How to Find and Use Your Biostat...Practical Biostatistics for Clinical Trials: How to Find and Use Your Biostat...
Practical Biostatistics for Clinical Trials: How to Find and Use Your Biostat...
 
Bias and errors
Bias and errorsBias and errors
Bias and errors
 
Understanding clinical trial's statistics
Understanding clinical trial's statisticsUnderstanding clinical trial's statistics
Understanding clinical trial's statistics
 
27 shweta journal club presentation
27 shweta journal club presentation27 shweta journal club presentation
27 shweta journal club presentation
 
t-test vs ANOVA
t-test vs ANOVAt-test vs ANOVA
t-test vs ANOVA
 
RESEARCH METHODOLOGY
RESEARCH METHODOLOGYRESEARCH METHODOLOGY
RESEARCH METHODOLOGY
 
Statistical tests of significance and Student`s T-Test
Statistical tests of significance and Student`s T-TestStatistical tests of significance and Student`s T-Test
Statistical tests of significance and Student`s T-Test
 
Sample size calculation - a brief overview
Sample size calculation - a brief overviewSample size calculation - a brief overview
Sample size calculation - a brief overview
 
Sample size
Sample sizeSample size
Sample size
 
3.1 non parametric test
3.1 non parametric test3.1 non parametric test
3.1 non parametric test
 
Statistical Distributions
Statistical DistributionsStatistical Distributions
Statistical Distributions
 

Similar to Sample Size: A couple more hints to handle it right using SAS and R

Critical Appriaisal Skills Basic 1 | May 4th 2011
Critical Appriaisal Skills Basic 1 | May 4th 2011Critical Appriaisal Skills Basic 1 | May 4th 2011
Critical Appriaisal Skills Basic 1 | May 4th 2011NES
 
Sample determinants and size
Sample determinants and sizeSample determinants and size
Sample determinants and sizeTarek Tawfik Amin
 
Critical Appraisal - Quantitative SS.pptx
Critical Appraisal - Quantitative SS.pptxCritical Appraisal - Quantitative SS.pptx
Critical Appraisal - Quantitative SS.pptxMrs S Sen
 
Non-inferiority and Equivalence Study design considerations and sample size
Non-inferiority and Equivalence Study design considerations and sample sizeNon-inferiority and Equivalence Study design considerations and sample size
Non-inferiority and Equivalence Study design considerations and sample sizenQuery
 
Eugm 2012 pritchett - application of adaptive sample size re-estimation in ...
Eugm 2012   pritchett - application of adaptive sample size re-estimation in ...Eugm 2012   pritchett - application of adaptive sample size re-estimation in ...
Eugm 2012 pritchett - application of adaptive sample size re-estimation in ...Cytel USA
 
Sample Size Determination.23.11.2021.pdf
Sample Size Determination.23.11.2021.pdfSample Size Determination.23.11.2021.pdf
Sample Size Determination.23.11.2021.pdfstatsanjal
 
Cluster randomised trials with excessive cluster sizes: ethical and design im...
Cluster randomised trials with excessive cluster sizes: ethical and design im...Cluster randomised trials with excessive cluster sizes: ethical and design im...
Cluster randomised trials with excessive cluster sizes: ethical and design im...Karla hemming
 
5 essential steps for sample size determination in clinical trials slideshare
5 essential steps for sample size determination in clinical trials   slideshare5 essential steps for sample size determination in clinical trials   slideshare
5 essential steps for sample size determination in clinical trials slidesharenQuery
 
Practical Methods To Overcome Sample Size Challenges
Practical Methods To Overcome Sample Size ChallengesPractical Methods To Overcome Sample Size Challenges
Practical Methods To Overcome Sample Size ChallengesnQuery
 
Sample size and power calculations
Sample size and power calculationsSample size and power calculations
Sample size and power calculationsRamachandra Barik
 
Dyfrig hughes che presentation 15 1 2014
Dyfrig hughes che presentation 15 1 2014Dyfrig hughes che presentation 15 1 2014
Dyfrig hughes che presentation 15 1 2014cheweb1
 
Clinical Research Statistics for Non-Statisticians
Clinical Research Statistics for Non-StatisticiansClinical Research Statistics for Non-Statisticians
Clinical Research Statistics for Non-StatisticiansBrook White, PMP
 
Eugm 2011 pocock - dm cs-and-adaptive-trials
Eugm 2011   pocock - dm cs-and-adaptive-trialsEugm 2011   pocock - dm cs-and-adaptive-trials
Eugm 2011 pocock - dm cs-and-adaptive-trialsCytel USA
 
Sample Size Estimation and Statistical Test Selection
Sample Size Estimation  and Statistical Test SelectionSample Size Estimation  and Statistical Test Selection
Sample Size Estimation and Statistical Test SelectionVaggelis Vergoulas
 
Sample size calculation
Sample  size calculationSample  size calculation
Sample size calculationSwati Singh
 
Sample size estimation
Sample size estimationSample size estimation
Sample size estimationHanaaBayomy
 
ASU Health Medical Odds Ratio for Lorcaserin Producing Questions.docx
ASU Health Medical Odds Ratio for Lorcaserin Producing Questions.docxASU Health Medical Odds Ratio for Lorcaserin Producing Questions.docx
ASU Health Medical Odds Ratio for Lorcaserin Producing Questions.docxwrite12
 
Sample size
Sample sizeSample size
Sample sizezubis
 

Similar to Sample Size: A couple more hints to handle it right using SAS and R (20)

Critical Appriaisal Skills Basic 1 | May 4th 2011
Critical Appriaisal Skills Basic 1 | May 4th 2011Critical Appriaisal Skills Basic 1 | May 4th 2011
Critical Appriaisal Skills Basic 1 | May 4th 2011
 
Sample determinants and size
Sample determinants and sizeSample determinants and size
Sample determinants and size
 
Critical Appraisal - Quantitative SS.pptx
Critical Appraisal - Quantitative SS.pptxCritical Appraisal - Quantitative SS.pptx
Critical Appraisal - Quantitative SS.pptx
 
Non-inferiority and Equivalence Study design considerations and sample size
Non-inferiority and Equivalence Study design considerations and sample sizeNon-inferiority and Equivalence Study design considerations and sample size
Non-inferiority and Equivalence Study design considerations and sample size
 
Biostatistics
BiostatisticsBiostatistics
Biostatistics
 
Eugm 2012 pritchett - application of adaptive sample size re-estimation in ...
Eugm 2012   pritchett - application of adaptive sample size re-estimation in ...Eugm 2012   pritchett - application of adaptive sample size re-estimation in ...
Eugm 2012 pritchett - application of adaptive sample size re-estimation in ...
 
Sample Size Determination.23.11.2021.pdf
Sample Size Determination.23.11.2021.pdfSample Size Determination.23.11.2021.pdf
Sample Size Determination.23.11.2021.pdf
 
Cluster randomised trials with excessive cluster sizes: ethical and design im...
Cluster randomised trials with excessive cluster sizes: ethical and design im...Cluster randomised trials with excessive cluster sizes: ethical and design im...
Cluster randomised trials with excessive cluster sizes: ethical and design im...
 
5 essential steps for sample size determination in clinical trials slideshare
5 essential steps for sample size determination in clinical trials   slideshare5 essential steps for sample size determination in clinical trials   slideshare
5 essential steps for sample size determination in clinical trials slideshare
 
Practical Methods To Overcome Sample Size Challenges
Practical Methods To Overcome Sample Size ChallengesPractical Methods To Overcome Sample Size Challenges
Practical Methods To Overcome Sample Size Challenges
 
Sample size calculation
Sample size calculationSample size calculation
Sample size calculation
 
Sample size and power calculations
Sample size and power calculationsSample size and power calculations
Sample size and power calculations
 
Dyfrig hughes che presentation 15 1 2014
Dyfrig hughes che presentation 15 1 2014Dyfrig hughes che presentation 15 1 2014
Dyfrig hughes che presentation 15 1 2014
 
Clinical Research Statistics for Non-Statisticians
Clinical Research Statistics for Non-StatisticiansClinical Research Statistics for Non-Statisticians
Clinical Research Statistics for Non-Statisticians
 
Eugm 2011 pocock - dm cs-and-adaptive-trials
Eugm 2011   pocock - dm cs-and-adaptive-trialsEugm 2011   pocock - dm cs-and-adaptive-trials
Eugm 2011 pocock - dm cs-and-adaptive-trials
 
Sample Size Estimation and Statistical Test Selection
Sample Size Estimation  and Statistical Test SelectionSample Size Estimation  and Statistical Test Selection
Sample Size Estimation and Statistical Test Selection
 
Sample size calculation
Sample  size calculationSample  size calculation
Sample size calculation
 
Sample size estimation
Sample size estimationSample size estimation
Sample size estimation
 
ASU Health Medical Odds Ratio for Lorcaserin Producing Questions.docx
ASU Health Medical Odds Ratio for Lorcaserin Producing Questions.docxASU Health Medical Odds Ratio for Lorcaserin Producing Questions.docx
ASU Health Medical Odds Ratio for Lorcaserin Producing Questions.docx
 
Sample size
Sample sizeSample size
Sample size
 

Recently uploaded

Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...ThinkInnovation
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)jennyeacort
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一F sss
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAbdelrhman abooda
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home ServiceSapana Sha
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]📊 Markus Baersch
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...Florian Roscheck
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 

Recently uploaded (20)

Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 

Sample Size: A couple more hints to handle it right using SAS and R

  • 1. Sample size: a couple more hints to handle it right using SAS and R Frankfurt 2018 Andrii Artemchuk, Kharkiv, Ukraine
  • 2. Page 2 A clinical trial must be carefully planned to achieve it’s objectives. Estimation of the sample size is an important part of planning a clinical trial – and usually a difficult one Why is it needed?
  • 3. Page 3 Balance is important Too big Too small
  • 4. Page 4 Methods of estimation Confidence intervals Bayesian approach Power analysis
  • 5. Page 5 • Level of significance • Power of the criterion • Data variability • Least expected treatment effect What affects the sample size
  • 6. Page 6 • Level of significance Sample size grows as the level of significance decreases, as well as decreases the probability of making type I error, i.e. probability of rejecting the tested hypothesis when it is correct. In practice, it is assumed to be 0.05 or 0.01 • Power of the criterion • Data variability • Least expected treatment effect What affects the sample size
  • 7. Page 7 • Level of significance • Power of the criterion The higher it is, the more likely it is to detect differences between the compared groups, and the greater statistical significance of the test criterion is. The larger power of the criterion is, the larger sample size is required • Data variability • Least expected treatment effect What affects the sample size
  • 8. Page 8 • Level of significance • Power of the criterion • Data variability When estimating sample size, it is often necessary to know the spread of the data, which is required to estimate the variance or the standard deviation. The bigger they are the larger sample size may be required • Least expected treatment effect What affects the sample size
  • 9. Page 9 • Level of significance • Power of the criterion • Data variability • Least expected treatment effect Treatment effect is the magnitude of the clinical benefit of the treatment, which is clinically important. It is often expressed through the difference in statistics: for example, through the difference between means, standard deviations or proportions What affects the sample size
  • 10. Page 10 Difficulties Variability is unknown, as the data has not been analyzed The magnitude of treatment effect is unknown before the trial is conducted Patients may be non-compliant to their treatment regimens Patient’s data may not be entered correctly, or patients may be lost to follow-up
  • 11. Page 11 Difficulties: Variability • Use the data from similar published trials, from literature or from a pilot study • Estimate the known min and max values of a parameter • Estimate standard deviation as the difference between the max and min known values of the parameter, divided by 4
  • 12. Page 12 Difficulties: Treatment effect • Try to determine direction of the effect and define its min and max values • Consider several options for the possible effect, estimate the sample size for each of them and choose the most optimal one • Find if it’s possible to allocate a budget for the inclusion of several more patients, in order to observe the effect, that can’t be seen at a current stage of a clinical trial
  • 13. Page 13 Difficulties: Treatment effect (cont.) • Assess whether the cost of including new patients is worthwhile to detect a difference between groups if at the current stage of a trial either the effect of the treatment is already present, or there is no effect at all • Do the opposite, and find out what effect will be unreasonable for detection
  • 14. Page 14 Difficulties: Non-compliance Recalculate sample size to include non-compliant patients in treatment and control groups !" = ! (1 − '( − '))+
  • 15. Page 15 Difficulties: Losses to follow-up Recalculate sample size to add percent of patients, that will not be included into the final analysis because of incorrect data or loss to follow-up !" = ! 1 − &
  • 16. Page 16 • SAS: PROC POWER • SAS: PROC GLMPOWER • R: PWR package • R: powerSurvEpi package • User defined functions in SAS Tools to estimate the sample size
  • 17. Page 17 The effect of Vitamin D compared to placebo on the prevention of neonatal hypocalcaemia is examined on pregnant women MAIN EFFICACY PARAMETER Serum calcium level MEAN 9.0mg/100ml STANDARD DEV 1.8 mg/100ml TREATMENT EFFECT Increase of 0.5 mg/100ml POWER 95% LEVEL OF SIGNIFICANCE 5% 1. PROC GLMPOWER in SAS: difference between means
  • 18. Page 18 1. PROC GLMPOWER in SAS: difference between means data oneway; level = "a1"; meanest = 9; output; level = "a2"; meanest = 9.5; output; run; proc glmpower data=oneway; class level; model meanest = level; power stddev = 1.8 alpha = 0.05 ntotal = . power = .95; run; The SAS System The GLMPOWER Procedure Computed N Total Error DF Actual Power N Total 674 0.950 676
  • 19. Page 19 2. PROC POWER in SAS: time-to-event data MAIN EFFICACY PARAMETER Risk of a heart attack STUDY TIME 5 years EVENT RATE IN CONTROL GROUP 20% TREATMENT EFFECT Decrease of rate to 15% POWER 80% LEVEL OF SIGNIFICANCE 5% The influence of HDL-Plus on the risk of a heart attack is studied. 20% of patients are expected to suffer a heart attack over the course of the 5 years. Patients taking HDL- Plus can expect their risk of a heart attack to decrease to approximately 15%
  • 20. Page 20 2. PROC POWER in SAS: time-to-event data proc power; twosamplesurvival test = logrank curve("Control") =(0 5):(1 0.8) curve("Treatment")=(0 5):(1 0.85) refsurvival = "Control" accrualtime = 2.5 followuptime = 2.5 hazardratio = 1.373 alpha = 0.05 sides = 2 ntotal = . power = 0.8; run; The SAS System The POWER Procedure Log-Rank Test for Two Survival Curves Computed N Total Actual Power N Total 0.800 1772
  • 21. Page 21 Formula for estimation of sample size: ! = 1 $% + $' ( + 1 ( − 1 * (,-. / * + ,-.0)* $' and $% are the probabilities of the event to happen of a patient in treatment and control groups respectively during a trial. ( = 234(-.56) 234(-.57) is a relative risk of the event occurrence, or hazard ratio. 3. User defined functions in SAS: time-to-event data
  • 22. Page 22 proc fcmp outlib = work.mysubs.myfunc; function twosamplelogrank(piT, piC, alpha, power); *Simple checks to make sure all parameters are valid; if 0 ge piC ge 1 or 0 ge piT ge 1 then do; put "%str(ER)ROR: check sample parameters input! Must be between 0 and 1!"; return; end; if 0 ge alpha ge 1 or 0 ge power ge 1 then do; put "%str(ER)ROR: check parameters alpha and power input! Must be between 0 and 1!"; return; end; theta = log(1 - piC) / log(1 - piT); N = ((theta + 1)**2)*(probit(1 - alpha/2) + probit(power))**2 / ( (piC + piT)*(theta - 1)**2 ); return(ceil(N)); endsub; run; 3. User defined functions in SAS: time-to-event data
  • 23. Page 23 3. User defined functions in SAS:
  • 24. Page 24 4. PWR package in R: difference between proportions The efficacy of corticosteroid injections compared to physiotherapy in treating a painful rigid shoulder is examined. Success means that 40% of patients have a response in the group where treatment is less effective MAIN EFFICACY PARAMETER Response to treatment RATE IN TREATMENT GROUP 65% RATE IN CONTROL GROUP 40% TREATMENT EFFECT Difference of 25% between groups POWER 80% LEVEL OF SIGNIFICANCE 5%
  • 25. Page 25 install.packages("pwr") library(pwr) effect <- ES.h(0.4, 0.65) pwr.2p.test(h = effect, n = NULL, sig.level = 0.05, power = 0.8, alternative = "two.sided") ## Difference of proportion ## power calculation for ## binomial distribution ## (arcsine transformation) ## ## h = 0.5060506 ## n = 61.29835 ## sig.level = 0.05 ## power = 0.8 ## alternative = two.sided ## ## NOTE: same sample sizes 4. PWR package in R: difference between proportions
  • 26. Page 26 Do results match? SAS R PROC GLMPOWER PROC POWER PWR package powerSurvEpi package User defined formulas Difference in means 676 676 676 - 674 Difference in proportions - 124 124 - 124 Time-to-event data - 1772 - Linear 1816 Linear 1816 Exp 1730
  • 27. Page 27 PLAN: It is highly important to calculate the required sample size before a clinical trial starts, so that the trial will not become a waste of resources. All aspects of the trial design must be taken into account for an accurate assessment Conclusions
  • 28. Page 28 ACT: Many resources are available, such as procedures in SAS and R that may reflect the clinical trial model in detail. The variety of these resources may help to check the results obtained Conclusions