% Load patient data and select a specific patient clear; load('all_fitted_params.mat'); pain_report_all = []; for jj=1:39 % load patient IDs into 'filename' filename = patient_IDs{jj}; % load patient reports for iterated stat/mech model fit patient_report_iter4 = csvread(strcat('Patient_report_fixk0 iteration4/',filename,'_report_fixk0.csv')); % load patient reports for first round of mech only fit patient_report_iter1 = csvread(strcat('Patient_report_fixk0/',filename,'_report_fixk0.csv')); % merge pain reports only (both first and fourth iteration) % file format is real report, iter1 predict, iter4 predict patient_report_both = [patient_report_iter1(2:3,:); patient_report_iter4(3,:)]; % append this patient report to all previous ones pain_report_all = [pain_report_all, patient_report_both]; end csvwrite('pain_report_all.csv', pain_report_all); % correlation between real and iter1 pain corrcoef(pain_report_all(1,:), pain_report_all(2,:)) % correlation between real and iter4 pain corrcoef(pain_report_all(1,:), pain_report_all(3,:)) %% This is for cross validation correlation load('uhatstat_vs_uhat_cv.mat') [R,P,RL,RU] = corrcoef(unnamed(:,1),unnamed(:,2)) figure plot(unnamed(:,2),unnamed(:,1),'.k', 'MarkerSize',20) xlabel('unmitigated pain u given by fitting mechanistic model to testing data','FontSize',12) ylabel('predicted u using statistical model on training data','FontSize',12) hold on plot(linspace(0,10,100),linspace(0,10,100),'k','LineWidth',1)