Dear Stata specialists,

I have seen the description of -rcsgen- on Paul Lambert's blog, stating that "The rcsgen command generates basis function for restricted cubic splines. The command is used by my stpm2 command to fit flexible parameric survival models.".

I was wondering what's the actual relationship between -rcsgen- and -stpm2-? Does -rcsgen- always be followed by -stpm2- (Or can -stpm2- work without -rcsgen-)?


(Some brief info about my study and data if you'd like to refer to:
I'm trying to use flexible parametric model to estimate Hazard ratio over time (at 1 year, 5 years and 10 years after start of follow up) and visualize HR change over time using survival data.

outcome: development of CVD (0/1)
main exposure: RA (0/1)
covariates: age (continuous), sex (0/1), region (categorical noted by 0-20)
censoring: death during follow-up, emigration during follow-up or end of study (0/1)
follow-up time: in years (from diagnosis of RA to development of CVD or censoring) )


Thank you in advance!

Best,
Z.