How do i set ud ordinal covariates with dummy variables in COX-PH regression?
5 views (last 30 days)
Show older comments
Hi everyone,
I'm running some survival analysis and I need to perform a COX multivareate regression, I'm using coxphfit however I'm not sure how to set categorical covariates as dummy variables into the multivariate model.
COX_MAT(:,1): Has the survival times
COX_MAT(:,4) Age as catergorical (0 <50, 1>=50)
COX_MAT(:,5): Treamtent 1, 2 or 3 (This is one I need set up as different dummy variables to analyze different levels)
COX_MAT(:,5): Different tumor types 1, 2, 3, 4, 5 (This is the other one I need set up as different dummy variables to analyze different levels)
coxphopt = statset('coxphfit');
coxphopt.Display = 'final';
coxphopt.MaxIter = 50;
[b,logl,H,stats] = coxphfit([COX_MAT(:,4),COX_MAT(:,5),COX_MAT(:,6)] ,...
COX_MAT(:,1),...
'Censoring',cell2mat(Patients_4_COX(:,3)),'baseline',0,'Options',coxphopt)
thank you very much!
0 Comments
Answers (0)
See Also
Categories
Find more on Industrial Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!