-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoadVxDxCoxPHModelFits.m
executable file
·64 lines (48 loc) · 1.85 KB
/
LoadVxDxCoxPHModelFits.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
function LoadVxDxCoxPHModelFits
tic;
%fp = 'Z:\elw\MATLAB\cw_analy\meta_data\';
fp = 'C:\Documents and Settings\williae1\cw_meta_data\';
if isunix
fp=strrep(fp,'G:','/media/SKI_G');
end
%fn = {'MUTTER_MASTER_ChestWall_Cox_DiVj_DVHs_fx-1_a2bInf.mat'};
fn = {'RIMNER_MASTER_ChestWall_Cox_DiVj_DVHs_fx-1_a2bInf.mat'};
CGobj = cell(length(fn),1);
% load data
for m = 1:length(fn)
load(strcat(fp,fn{m}),'CGobj_current');
CGobj{m} = CGobj_current;
end
CGobj = CGobj{m};
[VDxCox,flgCox,flganti] = CGobj.fCoxParameter_DVH('VDx'); % find availabe Cox models
flgCox(flganti)=false; % anti-correlations were not be considered
VDxCox = VDxCox(flgCox);
[DVxCox,flgCox,flganti] = CGobj.fCoxParameter_DVH('DVx'); % find availabe Cox models
flgCox(flganti)=false; % anti-correlations were not be considered
DVxCox = DVxCox(flgCox);
vd = [VDxCox.data_exposure];
num_vd = size(vd,2);
vd_compdate = [VDxCox.data_hazard];
compdate = [vd_compdate(:,1)];
dv = [DVxCox.data_exposure];
num_dv = size(dv,2);
flgcensor = [CGobj.mGrp.mFlgCensor]';
vxdx_logl = zeros(num_vd,num_dv);
vxdx_stats = cell(num_vd,num_dv);
disp(['Running V_{',num2str(num_vd),...
'} D_{',num2str(num_dv),'}']);
for d=1:num_vd
if ~mod(d,10)
disp(['V_{',num2str(d),'}']);
end
%cur_v=1;
for v=1:num_dv
[~,vxdx_logl(d,v),~,vxdx_stats{d,v}]=...
coxphfit([vd(:,d),dv(:,v)],compdate,'baseline',0,'censoring',flgcensor);
%cur_v=cur_v+4;
end
end
%save('Z:\elw\MATLAB\cw_analy\meta_data\CW_VxDx_CoxPHM.mat','vxdx_logl','vxdx_stats');
save('C:\Documents and Settings\williae1\cw_meta_data\RIMNER_CW_VxDx_CoxPHM.mat','vxdx_logl','vxdx_stats');
toc;
end