By running the following function, the output would be
library(pmsampsize)
pmsampsize(type = "s", csrsquared = 0.5, parameters = 10, rate = 0.065,
timepoint = 2, meanfup = 2.07)
NB: Assuming 0.05 acceptable difference in apparent & adjusted R-squared
NB: Assuming 0.05 margin of error in estimation of overall risk at time point = 2
NB: Events per Predictor Parameter (EPP) assumes overall event rate = 0.065
Samp_size Shrinkage Parameter CS_Rsq Max_Rsq Nag_Rsq EPP
Criteria 1 5143 0.900 30 0.051 0.555 0.092 23.07
Criteria 2 1039 0.648 30 0.051 0.555 0.092 4.66
Criteria 3 * 5143 0.900 30 0.051 0.555 0.092 23.07
Final SS 5143 0.900 30 0.051 0.555 0.092 23.07
Minimum sample size required for new model development based on user inputs = 5143,
corresponding to 10646 person-time** of follow-up, with 692 outcome events
assuming an overall event rate = 0.065 and therefore an EPP = 23.07
I am looking for a way (loop function) to run the following function for multiple values of csrsquared and parameters and brining all resullts including the value of r, value of parameter, minimum sample size, and outcome events into a table. Suppose
R=seq (from=0, to=0.5, by=0.1)
PA=seq(from=1, to=10, by=1)
pmsampsize(type = "s", csrsquared = R, parameters = PA, rate = 0.065, timepoint = 2, meanfup = 2.07)
the outcome should be sth like a table including different values of csrsquared and parameters, and their corresponding estimation for sample size and outcome events.
csrsquared parameters Minimum sample size outcome events
elisa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.