# Calculating the value of Cox-Snell Rsquared

I want to calculate the minimum sample size for a prospective longitudinal study (using cox regression - the aim of the project is prediction). The following function pmsampsize from the pmsampsize package in R can be used for the calculation (based on the following publication; Minimum sample size for developing models with continuous, binary or survival (time to event) outcomes. Riley et al. (2018)). To run the following function, we need to enter the value of csrsquared, which is the value of the Cox-Snell Rsquared of the new model.

pmsampsize(type = "s", csrsquared = , parameters = , rate = ,timepoint = , meanfup = )


If there are no pilot data and also no reported value of pseudo-R2 in the similarly established studies, how can the value of csrsquared be defined to use this function for calculation? 2. How to estimate the value of the Cox-Snell R-squared, assuming that the value of the pseudo-R2 is available.

I have a binary time dependent covariate in the model and there are only 9 time points. So I don't think the above function can be used for sample size calculation when the cox model includes a time dependent covariate and discrete survival time. But still, I'm interested in knowing how the pseudo-R2 can be predicted when there is no pilot data, assuming we have continuous survival time and all covariates are time independent.

In my study the patients come to the hospital every two months for check-ups. T0 ( one week before surgery), T1 (two months after surgery), T2 (4 months after surgery) up to T9 (18 months after surgery). There is one binary time dependent covariate and one continuous independent variable. Cases who dropped out before the event, completed follow up (T9) event-free are censored.

• Welcome to Cross Validated! Please edit the question to say more about the nature of the data and what you are trying to accomplish with this project. There might be better ways to accomplish what you want and to estimate the necessary sample size. As a rough rule of thumb, you need about 15 events (not total participants) per parameter, so if you have 30 parameters you will need roughly 450 events during the course of your study. Is that realistic?
– EdM
Commented Jun 5 at 17:19
• @ EdM, thanks so much for your time. I just modified the question based on your kind advice. Commented Jun 5 at 18:28

The simple answer is that any estimate of sample size in study design for regression modeling requires assumptions about the magnitude of the effect you want to be able to detect and the variability in the predictor and outcome values. If you have absolutely no information about those matters, then you really can't perform a proper power analysis to estimate the sample size. A pilot study would be needed to get you started, maybe one based on retrospective data from your institution.

In practice, there probably are already studies about the type of event in which you are interested that can help guide your study design, even if they don't include some specific predictors that you have in mind. Look for them.

The method for estimating the sample size in the reference you cite uses information from prior studies to provide an improvement over simple rules of thumb for avoiding over-fitting in later designed studies. The Cox-Snell pseudo-$$R^2$$ nicely encapsulates all that information about variability in predictors and outcomes, and about predictor-outcome associations, from a prior study.

Although that pseudo-$$R^2$$ is seldom reported in published survival models, a measure of concordance, the C-statistic, typically is. Section 3.3 of the reference you cite shows how to use a reported C-statistic to get an estimate of a corresponding Cox-Snell pseudo-$$R^2$$. If your model improves upon prior studies of that type of event, you will presumably have an even higher C-statistic. So working with the lower value from a previous study will be a good, conservative approach.

As you seem to be at an early stage of this project, however, I'd suggest that you first think carefully about the implications of the rule of thumb of 10-20 events per regression coefficient that you want to estimate. You presumably know something about how frequently the event occurs over time and how many new individuals at risk for the event are seen per year. That will provide at least a rough idea about whether this project is feasible.

Finally, if this is the same scenario as you describe in this question, I repeat my recommendation to get some local statistical and subject-matter advice to help with this study.

• I am so grateful for your time and kidness. Commented Jun 10 at 7:53