Diff for "FAQ/power/haz" - CBU statistics Wiki
location: Diff for "FAQ/power/haz"
Differences between revisions 13 and 60 (spanning 47 versions)
Revision 13 as of 2012-02-14 10:00:56
Size: 1046
Editor: PeterWatson
Comment:
Revision 60 as of 2017-03-28 11:40:38
Size: 4288
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Power may be evaluated for comparing hazard rates (per unit time) using this [attachment:coxpow.xls spreadsheet] which uses a simple formula taken from Collett (2003) [http://stats.stackexchange.com/questions/7508/power-analysis-for-survival-analysis illustrated here] corresponding to a group regression estimate (ratio of hazards) in a Cox regression model. Alternatively the effect size can be expressed in terms of ratios of group survival rates as used by the power calculator given [http://www.stattools.net/SSizSurvival_Pgm.php here.] Power may be evaluated for comparing hazard rates (per unit time) using this [[attachment:coxpow.xls|spreadsheet]] which uses a simple formula taken from Schoenfeld (1983), Hsieh and Lavori (2000) and [[attachment:powersa.pdf | Collett (2003, Chapter 10)]] corresponding to a group regression estimate (ratio of hazards) in a Cox regression model.
Line 5: Line 5:
Rearranging the equation given in Collett(2003) In particular from Schoenfeld (1983) the total number of events, d, required is
Line 7: Line 7:
Power = $$2 \Phi(\sqrt{np(1-p)hr^text{2}}-z_text{a/2})-1$$ d = $$[ ( z(a/2) + z(b) )^2 ^ ] / [ p(1-p)[log(hr)]^2 ^ ]$$
Line 9: Line 9:
where n is the total sample size, p the probability of occurrence of the event in the population, hr the hazard ratio, type I error a, $$\Phi$$ the inverse normal function and z the Standard Normal (or probit) function. Rearranging the above equation
Line 11: Line 11:
__Reference__ Power = $$\Phi(\sqrt{dp(1-p)[log hr]^2 ^-z(a/2))$$
Line 13: Line 13:
Collett, D (2003) Modelling Survival Data in Medical Research Second Edition. Chapman and Hall:London where ''d'' is the total number of events, ''p'' the probability of occurrence of the event in the population, ''hr'' the hazard ratio, ''a'' the two-sided type I error, $$\Phi$$ the inverse normal function and ''z'' the Standard Normal (or probit) function.

Hsieh and Lavori (2000) further give sample size formulae for the number of deaths using continuous covariates in the Cox regression.

d = $$[ (z(a/2) + z(b) )^2 ^] / [\sigma^2 ^ log(hr)^2 ^]

with $$\sigma^2 ^$$ \mbox{equal to the variance of the covariate}.

The ratio for a continuous covariate could be comparing rates at one sd above the mean to that at the mean.

dc = $$\frac{d}{1-R^text{2}}$$
where $$R^text{2}$$
is the squared multiple correlation regression of the covariate of interest with the others in the case of more than one continuous covariate. This method is computed using this [[attachment:powcoxc.xls|spreadsheet.]] The same equation for computing the power above, for a binary covariate, is used with $$\sigma^2 ^$$ \mbox{ replacing p(1-p)
as the variance of the covariate in the denominator}.

This approach is similar to Hsieh's approach to computing power in logistic regression (see [[FAQ/power/llogPow|here]].) This method may also be computed using the powerEpiCont function in R as illustrated [[FAQ/power/hazNR| here]].

Alternatively the effect size can be expressed in terms of ratios of group survival rates as used by the power calculators given [[http://powerandsamplesize.com/Calculators/Test-Time-To-Event-Data/Cox-PH-2-Sided-Equality | here]], which has R code as given below, and [[http://www.statstodo.com/SSizSurvival_Pgm.php|here]] which uses results from Machin et al. (1997, 2009). The free downloadable software [[http://www.brixtonhealth.com/pepi4windows.html|WINPEPI]] also computes this sample size and power for comparing two survival functions.

The R code mentioned above for Machin et al. example taken from [[http://powerandsamplesize.com/Calculators/Test-Time-To-Event-Data/Cox-PH-2-Sided-Equality | here]] where hr is the hazard ratio, hr0 is 1 (hr under the null hypothesis), pE is the overall probability of the event occurring within the study period, pA is the proportions of the sample size allotted to group 'A', alpha is type I error and beta is 1-power.

{{{
hr=2
hr0=1
pE=0.8
pA=0.5
alpha=0.05
beta=0.20
(n=((qnorm(1-alpha/2)+qnorm(1-beta))/(log(hr)-log(hr0)))^2/(pA*(1-pA)*pE))
ceiling(n) # 82
(Power=pnorm((log(hr)-log(hr0))*sqrt(n*pA*(1-pA)*pE)-qnorm(1-alpha/2)))
}}}

For the Collett example above we have hr=0.5729, pE=0.495, pA=0.5, alpha=0.05 and beta=0.1 which gives a total sample size of 274 (n) using the R code above which agrees with sample size worked out by Collett for his example.

__References__

[[attachment:collett-ch10.pdf | Collett, D (2003) Modelling Survival Data in Medical Research. Second Edition. Chapman and Hall:London]]

Hsieh FY and Lavori PW (2000)
[[http://www.sciencedirect.com/science/article/pii/S0197245600001045|Sample size calculations for the Cox proportional hazards regression models with nonbinary covariates]] ''Controlled Clinical Trials'' '''21''' 552-560. A downloaded pdf of this paper is [[attachment:hazsurv.pdf | here.]]

Machin D, Campbell M, Fayers, P and Pinol A (1997) Sample Size Tables for Clinical Studies. Second Ed. Blackwell Science IBSN 0-86542-870-0 p. 176-177.

Machin D, Campbell MJ, Tan SB and Tan SH (2009) Sample size tables for clinical studies. 3rd ed. Chichester: Wiley-Blackwell.

Schoenfeld DA (1983) Sample size formulae for the proportional hazards regression model. ''Biometrics'' '''39''' 499-503.

Survival analysis power calculations

Power may be evaluated for comparing hazard rates (per unit time) using this spreadsheet which uses a simple formula taken from Schoenfeld (1983), Hsieh and Lavori (2000) and Collett (2003, Chapter 10) corresponding to a group regression estimate (ratio of hazards) in a Cox regression model.

In particular from Schoenfeld (1983) the total number of events, d, required is

d = $$[ ( z(a/2) + z(b) )2 ] / [ p(1-p)[log(hr)]2 ]$$

Rearranging the above equation

Power = $$\Phi(\sqrt{dp(1-p)[log hr]2 -z(a/2))$$

where d is the total number of events, p the probability of occurrence of the event in the population, hr the hazard ratio, a the two-sided type I error, $$\Phi$$ the inverse normal function and z the Standard Normal (or probit) function.

Hsieh and Lavori (2000) further give sample size formulae for the number of deaths using continuous covariates in the Cox regression.

d = $$[ (z(a/2) + z(b) )2 ] / [\sigma2 log(hr)2 ]

with $$\sigma2 $$ \mbox{equal to the variance of the covariate}.

The ratio for a continuous covariate could be comparing rates at one sd above the mean to that at the mean.

dc = $$\frac{d}{1-R^text{2}}$$ where $$R^text{2}$$ is the squared multiple correlation regression of the covariate of interest with the others in the case of more than one continuous covariate. This method is computed using this spreadsheet. The same equation for computing the power above, for a binary covariate, is used with $$\sigma2 $$ \mbox{ replacing p(1-p) as the variance of the covariate in the denominator}.

This approach is similar to Hsieh's approach to computing power in logistic regression (see here.) This method may also be computed using the powerEpiCont function in R as illustrated here.

Alternatively the effect size can be expressed in terms of ratios of group survival rates as used by the power calculators given here, which has R code as given below, and here which uses results from Machin et al. (1997, 2009). The free downloadable software WINPEPI also computes this sample size and power for comparing two survival functions.

The R code mentioned above for Machin et al. example taken from here where hr is the hazard ratio, hr0 is 1 (hr under the null hypothesis), pE is the overall probability of the event occurring within the study period, pA is the proportions of the sample size allotted to group 'A', alpha is type I error and beta is 1-power.

hr=2
hr0=1
pE=0.8
pA=0.5
alpha=0.05
beta=0.20
(n=((qnorm(1-alpha/2)+qnorm(1-beta))/(log(hr)-log(hr0)))^2/(pA*(1-pA)*pE))
ceiling(n) # 82
(Power=pnorm((log(hr)-log(hr0))*sqrt(n*pA*(1-pA)*pE)-qnorm(1-alpha/2)))

For the Collett example above we have hr=0.5729, pE=0.495, pA=0.5, alpha=0.05 and beta=0.1 which gives a total sample size of 274 (n) using the R code above which agrees with sample size worked out by Collett for his example.

References

Collett, D (2003) Modelling Survival Data in Medical Research. Second Edition. Chapman and Hall:London

Hsieh FY and Lavori PW (2000) Sample size calculations for the Cox proportional hazards regression models with nonbinary covariates Controlled Clinical Trials 21 552-560. A downloaded pdf of this paper is here.

Machin D, Campbell M, Fayers, P and Pinol A (1997) Sample Size Tables for Clinical Studies. Second Ed. Blackwell Science IBSN 0-86542-870-0 p. 176-177.

Machin D, Campbell MJ, Tan SB and Tan SH (2009) Sample size tables for clinical studies. 3rd ed. Chichester: Wiley-Blackwell.

Schoenfeld DA (1983) Sample size formulae for the proportional hazards regression model. Biometrics 39 499-503.

None: FAQ/power/haz (last edited 2017-03-28 11:41:39 by PeterWatson)