I have a
data.frame with a column
Material that has 7 different codes for 7 different materials:
'AC', 'GGIJ', 'HPE', 'ONB', 'PE', 'PVC', 'ST'
Is there a way to stratify my data considering two or more of these as equivalent (i.e. generating 6 levels instead of 7 because for example
'PVC' is considered in the same level as
Specifically I'm using this for survival analysis with the
survive package. Trying to have more control on the
survdiff(formula = survObj ~ Material, data = data) and
survfit(survObj ~ Material., data = data) functions.
However, I see this also being useful for visualization or other types of data analysis.
I am aware I can do this by adding a column in the
data.frame, but since I need to try different combinations, I'd love to do it on-the-fly.