|
|
|
|
|
acuteTBI=IDENTITY.DEMO(:,3)==2;
|
|
Sx_idxs=unique(IDENTITY.DEMO(acuteTBI,1));
|
|
|
|
AttritionPredictors=NaN(length(Sx_idxs),14);
|
|
for sxi=1:length(Sx_idxs)
|
|
thisguy=Sx_idxs(sxi);
|
|
|
|
FIRST=find(logical( double(IDENTITY.DEMO(:,1)==thisguy) .* double(IDENTITY.DEMO(:,2)==1) ));
|
|
SECOND=find(logical( double(IDENTITY.DEMO(:,1)==thisguy) .* double(IDENTITY.DEMO(:,2)==2) ));
|
|
THIRD=find(logical( double(IDENTITY.DEMO(:,1)==thisguy) .* double(IDENTITY.DEMO(:,2)==3) ));
|
|
|
|
if ~isempty(FIRST), Attrition(sxi,1)=1;
|
|
AttritionPredictors_HDR={'age';'sex';'TOPF';'Coding';'Span';'HVLT13';'HVLTDelay';'GCS';'LOCtime';'LOM';'Days';'BDI';'NSI';'FrSBe'};
|
|
AttritionPredictors(sxi,:)=[...
|
|
IDENTITY.DEMO(FIRST,6:7),...
|
|
IDENTITY.NP(FIRST,4:8),...
|
|
IDENTITY.TBI(FIRST,[4,6:8]),...
|
|
IDENTITY.QUEX(FIRST,[4,5,10]),...
|
|
];
|
|
else Attrition(sxi,1)=0; end
|
|
if ~isempty(SECOND), Attrition(sxi,2)=1; else Attrition(sxi,2)=0; end
|
|
if ~isempty(THIRD), Attrition(sxi,3)=1; else Attrition(sxi,3)=0; end
|
|
|
|
clear thisguy FIRST SECOND THIRD;
|
|
end
|
|
|
|
|
|
AttritionPredictors=AttritionPredictors(~isnan(AttritionPredictors(:,1)),:);
|
|
Attrition=Attrition(~isnan(AttritionPredictors(:,1)),:);
|
|
|
|
|
|
for atti=1:size(AttritionPredictors,2)
|
|
for sessi=1:3
|
|
|
|
A=AttritionPredictors(:,atti);
|
|
B=Attrition(:,sessi);
|
|
|
|
A2=A(~isnan(A));
|
|
B2=B(~isnan(A));
|
|
|
|
|
|
|
|
[B_acc,DEV_acc,STATS_acc] = glmfit(zscore(A2),B2, 'binomial','link','logit');
|
|
Predictors_Logistic{sessi}(atti,1)=B_acc(2);
|
|
Predictors_Logistic{sessi}(atti,2)=STATS_acc.p(2);
|
|
|
|
[~,P,~,STATS]=ttest2(A2(B2==1),A2(B2==0));
|
|
Predictors_t{sessi}(atti,1)=STATS.tstat;
|
|
Predictors_t{sessi}(atti,2)=P;
|
|
|
|
[P,~,U]=ranksum(A2(B2==1),A2(B2==0));
|
|
Predictors_u{sessi}(atti,1)=U.zval;
|
|
Predictors_u{sessi}(atti,2)=P;
|
|
|
|
clear B_acc DEV_acc STATS_acc A B A2 B2 STATS P U;
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nanmean(AttritionPredictors(Attrition(:,2)==0,3:5))
|
|
|
|
nanmean(AttritionPredictors(Attrition(:,2)==1,3:5))
|
|
|
|
|
|
nanmean(AttritionPredictors(Attrition(:,3)==0,3:5))
|
|
|
|
nanmean(AttritionPredictors(Attrition(:,3)==1,3:5))
|
|
|
|
|
|
|