# Determining sample size for proportional hazard

I am in the design phase for a longitudinal study examining the effect of a predictor (neighborhood risk score) on time to an outcome (re-arrest), as well as whether or not the variation explained by the predictor is moderated by membership in one of two independent groups (those with substance use disorders vs. those without). Because the data is censored (I'm only observing for 12 months), I intend to use a proportional hazard model and to stratify by group membership to examine moderation. I also intend to control for several additional covariates (risk factors).

I have much to learn about this analysis, but to start I need to determine my sample size. I've read multiple methodological articles on power calculation and I still feel totally directionless. At present, I have data from the study population on the proportion of individuals who have the outcome vs. those who do not have the outcome within 12 months. I also have data on the proportion of the study population who fall into each of the groups of interest. I do not have the standard deviation for these values, nor do I have data on the covariates. For what it's worth, I use R.

Any assistance with the above or suggestions for easy to understand guides are much appreciated.

• Collett, D. (2003). Modelling Survival Data in Medical Research. Boca Raton: Chapman & Hall/CRC, 2nd ed. Section 10.2.1 – ocram Feb 26 '15 at 12:26
• check out R package 'powerSurvEpi' and 'LogrankPower' – Ronna Oct 12 at 18:18

In a power calculation, you assume a certain effect size (in this case a coefficient $\alpha$ in your proportional hazards model). You then calculate the sample size needed to attain a significant effect with some probability (often 80%). You could also be testing a hypothesis concerning more parameters simultaneously.

The methods for power calculations divide into the groups: formula-based and simulation-based.

For both classes of methods, you need do make some heavy assumptions. These assumptions can be varied to get a range of sample sizes needed under different conditions. Furthermore, you need to lock down a hypothesis. What is it, you would want to test? It seems to me that you what to test an interaction (how "substance use disorder" moderates/interacts with the neighborhood risk score).

## Formula-based

This article gives some formulae for sample-size calculations in the proportional hazards model.

Sample-size calculations for the Cox proportional hazards regression model with nonbinary covariates

Furthermore, it suggests a variance inflation factor. If other covariates in the model are correlated with the covariate of interest (as they will often be in observational studies but not in randomized studies), you'll have to take that into account, as explained in the article.

R is capable of doing a power calculation if you're interested in an interaction (however, only for two binary predictors, as far as I know).

R package powerSurvEpi

I hope this gives you a starting point for looking further into the formulae-based possibilites.

## Simulation-based

You can also assume that some model is true, simulate from it a number of times and simply calculation the power (how many times can you reject the hypothesis). This a more flexible approach but it might also require more work on your part. Using simulation you can calculate the power of the test (or even multiple tests) you want in just the model you want. See the below warning, though. The general simulation-based approach:

• Assume that some model is true (the model you intend to use when analyzing your data). Preferably based on subject knowledge.

• Simulate N subjects from this model, repeat M times, where M is a large number.

• Calculate the number of times where you were able to reject the hypothesis, you were interested in.

• Repeat for different N to get a power function (power as a function of N, the sample size).

## A Warning

Before finishing, I'll issue a warning. Power calculations assume that the model is true, that a long list of assumptions are fulfilled and so on. This is clearly not the case in any study, but they might be useful to know whether we need hundreds, thousands or tens of thousands of observations to get some result. However, beyond that, I wouldn't trust them too much. I might trust them a little more, if we have a good prior knowledge of the field and of good ways to do the modelling and if we can base our calculations on empirical data instead of (inspired?) guessing. However, in some applied fields they seem to be mandatory in applications for funding.

I think you can run simulation studies to get point estimate of power for a range of specified sample sizes. You can check out R package 'powerSurvEpi' and 'LogrankPower'. And here is the method description and the complete code for generating simulation datasets for power calculation under the log-rank test: https://github.com/RongUTSW/Methods/blob/master/LRPowerSimulation.pdf