You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across some unexpected behaviour when passing the "GroupOrder" flag. Specifically, the p-value differs depending on the order and in the last example below is a complex number. The GroupOrder flag worked as expected when testing it with the example datasets or other grouping variables of this dataset. I suspect the problem is related to convergence (the groups "appendix" and "others" have few patients with no events)
% Specifying "GroupsToUse" and including all the groups in the same order
% as default (NoOp) produces the expected Kaplan-Meier plot and stats
[p, fh, stats] = MatSurv(...
data.overall_survival_months,...
data.is_censored_overall_survival=='no',...
data.tumour_site,...
'GroupsToUse', {'appendix', 'distal', 'others', 'proximal', 'rectal'})
% Specifying "GroupsToUse" and including all the groups but in a different order
% than default produces the expected Kaplan-Meier plot, but reports
% different stats (and a complex number p-value in this case)
[p, fh, stats] = MatSurv(...
data.overall_survival_months,...
data.is_censored_overall_survival=='no',...
data.tumour_site,...
'GroupsToUse', {'appendix', 'proximal', 'distal', 'rectal', 'others'})
`
The text was updated successfully, but these errors were encountered:
Hello,
Thanks for taking time to find this bug! It turns out that the calculations of the log rank p-value do not work when there are two or more groups with no events. I have added a error checking for the groups that warns about this condition but still displays the KM-plot. I also by default remove groups with less than two samples. I have also added a so one can easily merge Groups with a multi-level cell structure as GroupsToUse input variable.
Your example would be fixed using:
[p, fh, stats] = MatSurv( data.overall_survival_months,data.is_censored_overall_survival=='no', data.tumour_site, 'GroupsToUse', {{'appendix+others','appendix','others'}, 'proximal', 'distal', 'rectal'});
Hi,
I came across some unexpected behaviour when passing the "GroupOrder" flag. Specifically, the p-value differs depending on the order and in the last example below is a complex number. The GroupOrder flag worked as expected when testing it with the example datasets or other grouping variables of this dataset. I suspect the problem is related to convergence (the groups "appendix" and "others" have few patients with no events)
`
% Data from https://bitbucket.org/manuela_s/translating_network_biomarkers_into_the_clinic/src/master/data/clinical_data.csv
data = readtable('clinical_data.csv');
% Drop patients with missing censoring information
data.is_censored_overall_survival = categorical(data.is_censored_overall_survival);
data = data(~isundefined(data.is_censored_overall_survival), :);
% Simple call generates correct Kaplan-Meier plot and reports stats
[p, fh, stats] = MatSurv(...
data.overall_survival_months,...
data.is_censored_overall_survival=='no',...
data.tumour_site)
% Specifying "GroupsToUse" and including all the groups in the same order
% as default (NoOp) produces the expected Kaplan-Meier plot and stats
[p, fh, stats] = MatSurv(...
data.overall_survival_months,...
data.is_censored_overall_survival=='no',...
data.tumour_site,...
'GroupsToUse', {'appendix', 'distal', 'others', 'proximal', 'rectal'})
% Specifying "GroupsToUse" and including all the groups but in a different order
% than default produces the expected Kaplan-Meier plot, but reports
% different stats (and a complex number p-value in this case)
[p, fh, stats] = MatSurv(...
data.overall_survival_months,...
data.is_censored_overall_survival=='no',...
data.tumour_site,...
'GroupsToUse', {'appendix', 'proximal', 'distal', 'rectal', 'others'})
`
The text was updated successfully, but these errors were encountered: