I'm involved in the design of a longitudinal observational study investigating a relationship between the use of a drug and a binary outcome.
Participants are enrolled when at risk of the outcome, they're followed up through time, checking if and when they receive the drug (which can happen at any time, and for varying durations) and if and when they meet the outcome.
For the main analysis, we are going to use a Cox model with a time-varying exposure.
Are you aware of any sample size calculation formula that would be appropriate for such a design? I don't think that a standard formula for survival analysis would be valid here.