# discrete time model and Logistic regression

To analyse discrete time cox PH (including time varying covariates), the following R function can be used: glm (family = binomial, link = "cloglog")

Since there is no open formula for calculating the sample size for discrete time cox PH, 1. I was wondering whether I could compute the sample size for a multiple logistic regression model instead.

2. When calculating the sample size for survival analysis, we refer to the number of events (rather than total participants), whereas in logistic regression, the calculated N refers to the number of participants. Am I correct?

In reverse order:

Question 2. The power of a survival model is a function of the number of events; that of logistic regression is a function of the number of cases in the minority class. In both situations you (or your software) needs to work with that fact to get the total required sample size that will provide the number of events (or minority-class members). In the survival model, that usually also requires taking into account the pattern of entry of individuals into the study over time. The "N" that's reported by power-analysis software is typically the total sample size, but read the documentation to know for sure (sometimes it's events, sometimes it's numbers per treatment group).

Question 1. Power calculations designed for logistic regression typically don't allow for things like the pattern of entry of individuals into the study over time or censoring that are critical for survival models (whether in discrete or continuous time). As you are intending to use the discrete-time version of a continuous-time Cox model, you should get a reasonable starting estimate by using power calculations designed for continuous-time survival models. Alternatively, you could simulate data representing your estimates of the outcomes per time interval for a very large number of individuals, then take multiple random samples of each of several different numbers of individuals to see the number of individuals needed to get the desired power.

• Thank you very much for your time. Unfortunately, because I am unfamiliar with simulation, I attempted to find another method to calculate the sample size for the discrete time survival model. According to this website theanalysisfactor.com/…, the logistic model can be employed when time survival is discrete. So I considered using logistic regression to get the sample size instead. So this site's comment is invalid and we cannot calculate the sample size based on logistic regression. Right? Commented Jun 19 at 20:00
• it seems ssizeEpi.default function in R can be used to calculate the sample size for Cox proportional hazards regression with two covariates for Epidemiological Studies. The covariate of interest should be a binary variable. In my prospective longitudinal study, the variable of interest has a binary format. My concern with this function is whether it can be utilised for both continuous and discrete survival times. Can I use this function when I am dealing with discrete time? Commented Jun 19 at 20:07
• @Stat2024 as I said in the answer, you can use logistic or other binomial regression to model survival in discrete time. The web page you cite is thus correct. "The trick" with that logistic regression, as that page says near the end, "is to set up the data correctly so that you incorporate the censoring." That's where you will get into trouble with power calculations for logistic regression; the usual calculators don't incorporate censoring.
– EdM
Commented Jun 19 at 20:58
• @Stat2024 I suspect that the continuous-time power estimates will be good enough for your purpose. But if this study is important enough to do, it's important to make sure that you do it right. Working with a local experienced statistician, with whom you can engage in a give-and-take to define the statistical and practical issues, is important. Although I have a fair amount of experience, I'm not a professional statistician. I greatly benefitted from such interactions with professional statisticians in my design of prospective survival studies.
– EdM
Commented Jun 19 at 21:07