Hi I currently have a model which i'm happy with
stcox var1 var2 var 3 var4
Var1 and var2 are continous and var3 and var4 are categorical.
I'm reading right now: Applied Survival Analysis by David W Hosmer
On the chapter 'Purposeful selection of covarites' it says,
Once you're happy with the model, to check the scale of continuous covariates using quartile design. From what I gather here, they are assessing for any deviation from non-linearity
They then proceed to graph the coeficients against group midpoints (green highlighted)
Please note, this is a rather old book, 2008

A lot has been said against categorisation including the paper here: Section: Perceived problems with non-linear modelling
Against quantiles: categorization of continuous variables in epidemiologic research, and its discontents - PMC (nih.gov)
My question, perhaps more for the statisticians/epidemiologists:
1. Should I have assessed the linearity of my continuous covariates before the model building using
2. Or If I have finalised my model do I check for linearity here of rmy conitnous variable here in order to check if any transformations are required ? And if so what is the best way to do it
Lowess as above? or perhaps using martingale residuals ?
I found a slightly non-linear pattern with age, is there a way I can transoform age to log and square it in stata ?


stcox var1 var2 var 3 var4
Var1 and var2 are continous and var3 and var4 are categorical.
I'm reading right now: Applied Survival Analysis by David W Hosmer
On the chapter 'Purposeful selection of covarites' it says,
Once you're happy with the model, to check the scale of continuous covariates using quartile design. From what I gather here, they are assessing for any deviation from non-linearity
They then proceed to graph the coeficients against group midpoints (green highlighted)
Please note, this is a rather old book, 2008
A lot has been said against categorisation including the paper here: Section: Perceived problems with non-linear modelling
Against quantiles: categorization of continuous variables in epidemiologic research, and its discontents - PMC (nih.gov)
My question, perhaps more for the statisticians/epidemiologists:
1. Should I have assessed the linearity of my continuous covariates before the model building using
Code:
lowess yvar xvar
Lowess as above? or perhaps using martingale residuals ?
Code:
stcox var1 var2, mgale(residuals) twoway (scatter residuals var1) lowess residuals var1)