-
Notifications
You must be signed in to change notification settings - Fork 0
/
GetPubPaper3Data.m
128 lines (92 loc) · 4.4 KB
/
GetPubPaper3Data.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
function [mdlSed, mdlWat]=GetPubPaper3Data()
%% GET PAPER 3 RESULTS AND RESPOND TO REVIEW COMMENTS
load('ARGdatawSoil.mat');
load('sSsR250mP3all.mat','szRt3');
missSed=szRt3{1, 2};
missWat=szRt3{2, 2};
SoilData=ARGdatawSoilProp(:,90:92);
SoilData=array2table(table2array(SoilData)>0.5);
SedSoilData=SoilData(~missSed,:);
WatSoilData=SoilData(~missWat,:);
%% ermB
%
load('ResultsTablesPaper3ermB_v1.mat');
InModelSed=Results(5, 1).Models.VariableInfo.InModel;
SedMat=Results(5, 1).Models.Variables(:,InModelSed);
SedMat(:,end+1:end+3)=SedSoilData;
SedMat.Properties.VariableNames(end:-1:end-2)=[{'Soil10'}, {'Soil06'}, {'Soil01'}];
SedMat.Response=Results(5, 1).Models.Variables.Response;
mdlSed{1}=stepwiselm(SedMat,'constant','Upper','linear','Criterion','aic');
InModelWat=Results(5, 2).Models.VariableInfo.InModel;
WatMat=Results(5, 2).Models.Variables(:,InModelWat);
WatMat(:,end+1:end+3)=WatSoilData;
WatMat.Properties.VariableNames(end:-1:end-2)=[{'Soil10'}, {'Soil06'}, {'Soil01'}];
WatMat.Response=Results(5, 2).Models.Variables.Response;
mdlWat{1}=stepwiselm(WatMat,'constant','Upper','linear','Criterion','aic');
%% tetW
%
load('ResultsTablesPaper3tetW_v1.mat')
InModelSed=Results(5, 1).Models.VariableInfo.InModel;
SedMat=Results(5, 1).Models.Variables(:,InModelSed);
SedMat(:,end+1:end+3)=SedSoilData;
SedMat.Properties.VariableNames(end:-1:end-2)=[{'Soil10'}, {'Soil06'}, {'Soil01'}];
SedMat.Response=Results(5, 1).Models.Variables.Response;
mdlSed{2}=stepwiselm(SedMat,'constant','Upper','linear','Criterion','aic');
InModelWat=Results(5, 2).Models.VariableInfo.InModel;
WatMat=Results(5, 2).Models.Variables(:,InModelWat);
WatMat(:,end+1:end+3)=WatSoilData;
WatMat.Properties.VariableNames(end:-1:end-2)=[{'Soil10'}, {'Soil06'}, {'Soil01'}];
WatMat.Response=Results(5, 2).Models.Variables.Response;
mdlWat{2}=stepwiselm(WatMat,'constant','Upper','linear','Criterion','aic');
%% qnrA
load('ResultsTablesPaper3qnrA_v1.mat')
InModelSed=Results(5, 1).Models.VariableInfo.InModel;
SedMat=Results(5, 1).Models.Variables(:,InModelSed);
SedMat(:,end+1:end+3)=SedSoilData;
SedMat.Properties.VariableNames(end:-1:end-2)=[{'Soil10'}, {'Soil06'}, {'Soil01'}];
SedMat.Response=Results(5, 1).Models.Variables.Response;
mdlSed{3}=stepwiselm(SedMat,'constant','Upper','linear','Criterion','aic');
InModelWat=Results(5, 2).Models.VariableInfo.InModel;
WatMat=Results(5, 2).Models.Variables(:,InModelWat);
WatMat(:,end+1:end+3)=WatSoilData;
WatMat.Properties.VariableNames(end:-1:end-2)=[{'Soil10'}, {'Soil06'}, {'Soil01'}];
WatMat.Response=Results(5, 2).Models.Variables.Response;
mdlWat{3}=stepwiselm(WatMat,'constant','Upper','linear','Criterion','aic');
%% sul1
load('ResultsTablesPaper3sul1_v1.mat')
InModelSed=Results(5, 1).Models.VariableInfo.InModel;
SedMat=Results(5, 1).Models.Variables(:,InModelSed);
SedMat(:,end+1:end+3)=SedSoilData;
SedMat.Properties.VariableNames(end:-1:end-2)=[{'Soil10'}, {'Soil06'}, {'Soil01'}];
SedMat.Response=Results(5, 1).Models.Variables.Response;
mdlSed{4}=stepwiselm(SedMat,'constant','Upper','linear','Criterion','aic');
InModelWat=Results(5, 2).Models.VariableInfo.InModel;
WatMat=Results(5, 2).Models.Variables(:,InModelWat);
WatMat(:,end+1:end+3)=WatSoilData;
WatMat.Properties.VariableNames(end:-1:end-2)=[{'Soil10'}, {'Soil06'}, {'Soil01'}];
WatMat.Response=Results(5, 2).Models.Variables.Response;
mdlWat{4}=stepwiselm(WatMat,'constant','Upper','linear','Criterion','aic');
%% intI1
load('ResultsTablesPaper3intI1_v1.mat')
load('InformedSPsPaper3intI1_v1.mat')
newcol=SSVs(5, 1).InformedSPs.HDD2;
TBL=Results(5, 1).Models.Variables;
Response=TBL.Response;
TBL(:,end)=[];
TBL(:,"Devel2")=[];
TBL.HDD2=newcol;
TBL.Response=Response;
% re-run stepwise selection
mdl=stepwiselm(TBL,'constant','Upper','linear','Criterion','aic');
InModelSed=mdl.VariableInfo.InModel;
SedMat=mdl.Variables(:,InModelSed);
SedMat(:,end+1:end+3)=SedSoilData;
SedMat.Properties.VariableNames(end:-1:end-2)=[{'Soil10'}, {'Soil06'}, {'Soil01'}];
SedMat.Response=mdl.Variables.Response;
mdlSed{5}=stepwiselm(SedMat,'constant','Upper','linear','Criterion','aic');
InModelWat=Results(5, 2).Models.VariableInfo.InModel;
WatMat=Results(5, 2).Models.Variables(:,InModelWat);
WatMat(:,end+1:end+3)=WatSoilData;
WatMat.Properties.VariableNames(end:-1:end-2)=[{'Soil10'}, {'Soil06'}, {'Soil01'}];
WatMat.Response=Results(5, 2).Models.Variables.Response;
mdlWat{5}=stepwiselm(WatMat,'constant','Upper','linear','Criterion','aic');