Appendix
Table A1.
EQ-5D-3L scores at 0 to 48-months post-operation for patients undergoing a modified AMI amputation, mean (SE), with the change from each timepoint to baseline.
Table A1.
EQ-5D-3L scores at 0 to 48-months post-operation for patients undergoing a modified AMI amputation, mean (SE), with the change from each timepoint to baseline.
EQ-5D-3L parameter |
0 |
1.5 |
3 |
6 |
9 |
12 |
24 |
36 |
48 |
N |
27-28 |
23-24 |
23-24 |
22 |
22 |
22 |
14 |
4 |
3 |
Index value |
0.49 (0.03) |
0.65 (0.04) |
0.73 (0.04) |
0.81 (0.04) |
0.77 (0.04) |
0.85 (0.04) |
0.83 (0.05) |
0.87 (0.08) |
0.84 (0.10) |
Change (95% CI) |
- |
0.16 (0.07, 0.24) |
0.24 (0.16, 0.33) |
0.33 (0.24, 0.41) |
0.29 (0.20, 0.37) |
0.36 (0.27, 0.45) |
0.34 (0.24, 0.45) |
0.38 (0.21, 0.55) |
0.35 (0.15, 0.54) |
p-value |
- |
0.0004 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
0.0005 |
VAS |
56.67 (3.26) |
74.21 (3.51) |
76.33 (3.51) |
83.02 (3.59) |
78.33 (3.59) |
81.09 (3.59) |
84.38 (4.42) |
87.46 (8.03) |
74.23 (9.33) |
Change (95% CI) |
- |
17.54 (8.96, 26.11) |
19.66 (11.05, 28.28) |
26.35 (17.59, 35.12) |
21.67 (12.90, 30.44) |
24.42 (15.66, 33.18) |
27.71 (17.62, 37.81) |
30.79 (14.06, 47.51) |
17.56 (-1.56, 36.69) |
p-value |
- |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
0.0004 |
0.0716 |
Table A2.
LEFS scores at 0 to 48-months post-operation for patients undergoing a modified AMI amputation, mean (SE), with the change from each timepoint to baseline.
Table A2.
LEFS scores at 0 to 48-months post-operation for patients undergoing a modified AMI amputation, mean (SE), with the change from each timepoint to baseline.
LEFS parameter |
0 |
1.5 |
3 |
6 |
9 |
12 |
24 |
36 |
48 |
N |
28 |
24 |
24 |
24 |
22 |
21 |
14 |
4 |
4 |
LEFS score |
31.96 (2.84) |
33.27 (3.00) |
41.95 (3.04) |
53.63 (3.05) |
54.88 (3.10) |
59.04 (3.14) |
59.55 (3.65) |
58.79 (6.20) |
51.74 (7.22) |
Change (95% CI) |
- |
1.31 (-4.90, 7.52) |
9.99 (3.67, 16.32) |
21.68 (15.32, 28.04) |
22.93 (16.47, 29.38) |
27.09 (20.54, 33.63) |
27.59 (20.11, 35.07) |
26.84 (14.36, 39.31) |
19.78 (5.38, 34.19) |
p-value |
- |
0.6772 |
0.0022 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
0.0075 |
Table A3.
PROMIS T-scores at 0 to 48-months post-operation for patients undergoing a modified AMI amputation, mean (SE), with the change from each timepoint to baseline.
Table A3.
PROMIS T-scores at 0 to 48-months post-operation for patients undergoing a modified AMI amputation, mean (SE), with the change from each timepoint to baseline.
SF-36 Component Score |
0 |
1.5 |
3 |
6 |
9 |
12 |
24 |
36 |
48 |
N |
28 |
23 |
24 |
24 |
22 |
20 |
15 |
2 |
5 |
Physical Component Score |
26.39 (1.79) |
26.47 (1.92) |
35.05 (1.89) |
42.74 (1.89) |
41.75 (1.95) |
43.28 (2.02) |
44.01 (2.25) |
37.00 (5.43) |
42.77 (3.59) |
Change (95% CI) |
- |
0.08 (-3.92, 4.08) |
8.66 (4.68, 12.65) |
16.35 (12.35, 20.35) |
15.36 (11.24, 19.48) |
16.90 (12.65, 21.14) |
17.62 (12.97, 22.27) |
10.61 (-0.20, 21.43) |
16.39 (9.17, 23.61) |
p-value |
- |
0.9686 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
0.05 |
<.0001 |
Mental Component Score |
47.99 (1.88) |
53.28 (2.02) |
56.31 (1.99) |
57.19 (1.99) |
54.59 (2.06) |
55.09 (2.13) |
55.95 (2.39) |
58.48 (5.88) |
53.35 (3.87) |
Change (95% CI) |
- |
5.29 (0.93, 9.66) |
8.32 (3.98, 12.66) |
9.21 (4.85, 13.56) |
6.60 (2.11, 11.09) |
7.11 (2.49, 11.72) |
7.96 (2.90, 13.02) |
10.49 (-1.29, 22.26) |
5.36 (-2.49, 13.21) |
p-value |
- |
0.0178 |
0.0002 |
<.0001 |
0.0042 |
0.0028 |
0.0023 |
0.0804 |
0.1791 |
Table A4.
SF-36 physical and mental scores at 0 to 48-months post-operation for patients undergoing a modified AMI amputation, mean (SE), with the change from each timepoint to baseline.
Table A4.
SF-36 physical and mental scores at 0 to 48-months post-operation for patients undergoing a modified AMI amputation, mean (SE), with the change from each timepoint to baseline.
PROMIS domain |
0 |
1.5 |
3 |
6 |
9 |
12 |
24 |
36 |
48 |
N |
28 |
23-24 |
23-24 |
23-24 |
22 |
21 |
14 |
4 |
3-4 |
Pain Interference |
65.86 (1.52) |
58.55 (1.67) |
55.13 (1.64) |
50.20 (1.67) |
49.52 (1.74) |
50.15 (1.74) |
49.24 (2.10) |
47.25 (3.83) |
53.51 (3.85) |
Change (95% CI) |
- |
-7.31 (-11.37, -3.25) |
-10.74 (-14.75, -6.72) |
-15.66 (-19.75, -11.58) |
-16.35 (-20.55, -12.14) |
-15.71 (-19.91, -11.52) |
-16.62 (-21.41, -11.84) |
-18.61 (-26.57, -10.66) |
-12.35 (-20.32, -4.39) |
p-value |
- |
0.0005 |
<0.001 |
<0.001 |
<0.001 |
<0.001 |
<0.001 |
<0.001 |
0.0026 |
Ability to Participate in Social Roles/Activities |
37.68 (1.64) |
41.43 (1.76) |
44.54 (1.73) |
53.63 (1.76) |
50.68 (1.79) |
52.50 (1.82) |
54.82 (2.11) |
54.36 (3.58) |
55.20 (3.62) |
Change (95% CI) |
- |
3.75 (0.11, 7.39) |
6.86 (3.26, 10.46) |
15.95 (12.29, 19.62) |
13.00 (9.28, 16.73) |
14.82 (11.05, 18.60) |
17.14 (12.83, 21.45) |
16.68 (9.49, 23.87) |
17.52 (10.28, 24.76) |
p-value |
- |
0.0434 |
0.0003 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
Physical Functioning |
33.78 (1.57) |
31.03 (1.65) |
37.22 (1.66) |
44.58 (1.66) |
44.75 (1.70) |
46.55 (1.73) |
47.77 (1.99) |
46.29 (3.31) |
46.37 (3.36) |
Change (95% CI) |
- |
-2.74 (-6.02, 0.54) |
3.45 (0.15, 6.74) |
10.81 (7.49, 14.11) |
10.97 (7.56, 14.38) |
12.77 (9.32, 16.23) |
14.00 (10.05, 17.94) |
12.51 (5.92, 19.10) |
12.59 (5.95, 19.23) |
p-value |
- |
0.1003 |
0.0405 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
0.0003 |
0.0003 |
Fatigue |
56.99 (1.81) |
51.14 (1.90) |
48.75 (1.90) |
46.43 (1.90) |
45.55 (1.95) |
44.42 (1.97) |
42.71 (2.24) |
41.98 (3.64) |
54.51 (3.69) |
Change (95% CI) |
- |
-5.85 (-9.39, -2.31) |
-8.24 (-11.80, -4.69) |
-10.56 (-14.13, -6.98) |
-11.44 (-15.12, -7.76) |
-12.57 (-16.31, -8.84) |
-14.28 (-18.55, -10.01) |
-15.01 (-22.12, -7.89) |
-2.48 (-9.66, 4.70) |
p-value |
- |
0.0014 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
0.4953 |
Anxiety/Fear |
54.31 (1.82) |
48.63 (1.91) |
46.94 (1.91) |
44.97 (1.91) |
46.79 (1.96) |
46.30 (1.99) |
46.61 (2.27) |
43.41 (3.73) |
48.60 (3.78) |
Change (95% CI) |
- |
-5.68 (-9.33, -2.02) |
-7.37 (-11.04, -3.70) |
-9.34 (-13.03, -5.65) |
-7.52 (-11.32, -3.72) |
-8.01 (-11.86, -4.16) |
-7.70 (-12.10, -3.29) |
-10.90 (-18.25, -3.55) |
-5.71 (-13.12, 1.70) |
p-value |
- |
0.0026 |
0.0001 |
<.0001 |
0.0001 |
<.0001 |
0.0007 |
0.0040 |
0.1296 |
Sleep Disturbance |
57.10 (1.55) |
54.98 (1.69) |
49.94 (1.66) |
48.23 (1.69) |
47.61 (1.72) |
48.24 (1.75) |
49.91 (2.07) |
52.34 (3.67) |
53.92 (3.70) |
Change (95% CI) |
- |
-2.12 (-5.93, 1.70) |
-7.16 (-10.93, -3.38) |
-8.88 (-12.72, -5.04) |
-9.50 (-13.40, -5.60) |
-8.86 (-12.81, -4.91) |
-7.19 (-11.70, -2.68) |
-4.76 (-12.28, 2.75) |
-3.18 (-10.73, 4.37) |
p-value |
- |
0.2736 |
0.0003 |
<.0001 |
<.0001 |
<.0001 |
0.0020 |
0.2121 |
0.4058 |
Depression/Sadness |
49.93 (1.50) |
46.72 (1.57) |
44.68 (1.57) |
44.44 (1.57) |
44.55 (1.61) |
46.11 (1.64) |
43.57 (1.87) |
40.29 (3.06) |
44.94 (3.10) |
Change (95% CI) |
- |
-3.22 (-6.21, -0.22) |
-5.25 (-8.26, -2.24) |
-5.48 (-8.51, -2.46) |
-5.38 (-8.49, -2.26) |
-3.82 (-6.97, -0.66) |
-6.36 (-9.97, -2.75) |
-9.63 (-15.66, -3.61) |
-4.99 (-11.06, 1.08) |
p-value |
- |
0.0355 |
0.0008 |
0.0005 |
0.0009 |
0.0181 |
0.0007 |
0.0019 |
0.1062 |
Table A5.
SIP dysfunction scores at 0 to 48-months post-operation for patients undergoing a modified AMI amputation, mean (SE), with the change from each timepoint to baseline.
Table A5.
SIP dysfunction scores at 0 to 48-months post-operation for patients undergoing a modified AMI amputation, mean (SE), with the change from each timepoint to baseline.
SIP parameter |
0 |
1.5 |
3 |
6 |
9 |
12 |
24 |
36 |
48 |
N |
29 |
25 |
25 |
24 |
24 |
22 |
15 |
4 |
3 |
Dysfunction Score |
18.81 (2.84) |
19.24 (3.00) |
12.63 (3.04) |
7.96 (3.05) |
9.03 (3.10) |
5.10 (3.14) |
9.45 (3.65) |
6.05 (6.20) |
8.68 (7.22) |
Change (95% CI) |
- |
0.43 (-3.18, 4.05) |
-6.18 (-9.81, -2.55) |
-10.84 (-14.55, -7.14) |
-9.78 (-13.48, -6.07) |
-13.71 (-17.52, -9.90) |
-9.36 (-13.66, -5.06) |
-12.75 (-20.14, -5.37) |
-10.12 (-18.69, -1.55) |
p-value |
- |
0.8124 |
0.0010 |
<.0001 |
<.0001 |
<.0001 |
<.0001 |
0.0008 |
0.0210 |
MATLAB Scripts
EQ-5D-3L Valuation
%Uploading raw EQ-5D-3L data
% filename=input('Please input the filename:','s');
filename='EQ5D3L_Redcap.csv';
opts = detectImportOptions(filename);
opts = setvartype(opts,'char');
T = readtable(filename,opts);
C=table2cell(T);
T=[T.Properties.VariableNames;C];
tf = cellfun('isempty',T); % true for empty cells
T(tf) = {'0'};
[rows, cols]=size(T);
%Converting data type from string to double for mathematical functions
for i=2:rows
for j=3:cols
T{i,j}=str2double(T{i,j});
end
end
%Creating health state vector (i.e. 12312)
for i=2:rows
for j=3:cols
T{i,8}=[T{i,3},T{i,4},T{i,5},T{i,6},T{i,7}];
end
end
Output(:,1)=T(:,1);
Output(:,2)=T(:,2);
Output(:,3)=T(:,8);
Output{1,3}='Health State';
Output{1,4}='Level 2';
Output{1,5}='Level 3';
Output{1,6}='Predicted Value';
%Deriving an EQ-5D index value from the health state
%The index is calculated by deducting the appropriate weights from 1, the value for full health (i.e. state 11111).
%Calculations made according to USA standard EQ-5D-3L value set
for i=2:rows
if Output{i,3}==0
Output{i,3}=0;
else
Output{i,4} = sum(Output{i,3} == 2);
Output{i,5} = sum(Output{i,3} == 3);
end
end
for i=2:rows
x=1.0;
if Output{i,3}==0
Output{i,3}=0;
elseif Output{i,3}(1)==2
x=x-0.146016;
elseif Output{i,3}(1)==3
x=x-0.557685;
end
if Output{i,3}==0
elseif Output{i,3}(2)==2
x=x-0.1753425;
elseif Output{i,3}(2)==3
x=x-0.4711896;
end
if Output{i,3}==0
elseif Output{i,3}(3)==2
x=x-0.1397295;
elseif Output{i,3}(3)==3
x=x-0.3742594;
end
if Output{i,3}==0
elseif Output{i,3}(4)==2
x=x-0.1728907;
elseif Output{i,3}(4)==3
x=x-0.5371011;
end
if Output{i,3}==0
elseif Output{i,3}(5)==2
x=x-0.156223;
elseif Output{i,3}(5)==3
x=x-0.4501876;
end
if Output{i,3}==0
elseif Output{i,4}+Output{i,5} >= 2
x=x-(-0.1395949)*(Output{i,4}+Output{i,5}-1);
end
if Output{i,3}==0
elseif Output{i,4} >= 2
x=x-(0.0106868*(Output{i,4}-1)^2);
end
if Output{i,3}==0
elseif Output{i,5} >= 2
x=x-(-0.1215579*(Output{i,5}-1));
x=x-(-0.0147963*(Output{i,5}-1)^2);
end
Output{i,6}=round(x,3);
end
for i=2:rows
if Output{i,3}==0
Output{i,6}=[];
end
end
%Exporting index values
Export_Data(:,1)=Output(:,1);
Export_Data(:,2)=Output(:,2);
Export_Data(:,3)=Output(:,6);
Export_Data=cell2table(Export_Data);
writetable(Export_Data,'EQ5D3L Valuation.xls');
SF-36 Scoring
%Uploading raw EQ-5D-3L data
% filename=input('Please input the filename:','s');
filename='Precoded SF36 12-27.csv';
opts = detectImportOptions(filename);
opts = setvartype(opts,'char');
T = readtable(filename,opts);
C=table2cell(T);
T=[T.Properties.VariableNames;C];
tf = cellfun('isempty',T); % true for empty cells
T(tf) = {'0'};
[rows, cols]=size(T);
%Converting data type from string to double for mathematical functions
for i=2:rows
for j=3:cols
T{i,j}=str2double(T{i,j});
end
end
Output=T;
%Recoding REDCap survey responses to weighted score
%(Ware J, Snow K, Kosinski M, Gandek B. SF-36 Health Survey Manual &
%Interpretation Guide)
for i=2:rows
if Output{i,23}==1
Output{i,23}=6.0;
elseif Output{i,23}==2
Output{i,23}=5.4;
elseif Output{i,23}==3
Output{i,23}=4.2;
elseif Output{i,23}==4
Output{i,23}=3.1;
elseif Output{i,23}==5
Output{i,23}=2.2;
elseif Output{i,23}==6
Output{i,23}=1.0;
end
end
for i=2:rows
if T{i,23}==0 && T{i,24}==1
Output{i,24}=6.0;
elseif T{i,23}==0 && T{i,24}==2
Output{i,24}=4.75;
elseif T{i,23}==0 && T{i,24}==3
Output{i,24}=3.5;
elseif T{i,23}==0 && T{i,24}==4
Output{i,24}=2.25;
elseif T{i,23}==0 && T{i,24}==5
Output{i,24}=1.0;
end
end
for i=2:rows
if T{i,23}==1 && T{i,24}==1
Output{i,24}=6;
elseif T{i,23}~=1 && T{i,24}==1
Output{i,24}=5;
elseif T{i,24}==2
Output{i,24}=4;
elseif T{i,24}==3
Output{i,24}=3;
elseif T{i,24}==4
Output{i,24}=2;
elseif T{i,24}==5
Output{i,24}=1;
end
end
for i=2:rows
if Output{i,3}==1
Output{i,3}=5.0;
elseif Output{i,3}==2
Output{i,3}=4.4;
elseif Output{i,3}==3
Output{i,3}=3.4;
elseif Output{i,3}==4
Output{i,3}=2.0;
elseif Output{i,3}==5
Output{i,3}=1.0;
end
end
for i=2:rows
if Output{i,36}==1
Output{i,36}=5.0;
elseif Output{i,36}==2
Output{i,36}=4.0;
elseif Output{i,36}==3
Output{i,36}=3.0;
elseif Output{i,36}==4
Output{i,36}=2.0;
elseif Output{i,36}==5
Output{i,36}=1.0;
end
end
for i=2:rows
if Output{i,38}==1
Output{i,38}=5.0;
elseif Output{i,38}==2
Output{i,38}=4.0;
elseif Output{i,38}==3
Output{i,38}=3.0;
elseif Output{i,38}==4
Output{i,38}=2.0;
elseif Output{i,38}==5
Output{i,38}=1.0;
end
end
for i=2:rows
if Output{i,25}==1
Output{i,25}=6.0;
elseif Output{i,25}==2
Output{i,25}=5.0;
elseif Output{i,25}==3
Output{i,25}=4.0;
elseif Output{i,25}==4
Output{i,25}=3.0;
elseif Output{i,25}==5
Output{i,25}=2.0;
elseif Output{i,25}==6
Output{i,25}=1.0;
end
end
for i=2:rows
if Output{i,29}==1
Output{i,29}=6.0;
elseif Output{i,29}==2
Output{i,29}=5.0;
elseif Output{i,29}==3
Output{i,29}=4.0;
elseif Output{i,29}==4
Output{i,29}=3.0;
elseif Output{i,29}==5
Output{i,29}=2.0;
elseif Output{i,29}==6
Output{i,29}=1.0;
end
end
for i=2:rows
if Output{i,22}==1
Output{i,22}=5.0;
elseif Output{i,22}==2
Output{i,22}=4.0;
elseif Output{i,22}==3
Output{i,22}=3.0;
elseif Output{i,22}==4
Output{i,22}=2.0;
elseif Output{i,22}==5
Output{i,22}=1.0;
end
end
for i=2:rows
if Output{i,28}==1
Output{i,28}=6.0;
elseif Output{i,28}==2
Output{i,28}=5.0;
elseif Output{i,28}==3
Output{i,28}=4.0;
elseif Output{i,28}==4
Output{i,28}=3.0;
elseif Output{i,28}==5
Output{i,28}=2.0;
elseif Output{i,28}==6
Output{i,28}=1.0;
end
end
for i=2:rows
if Output{i,32}==1
Output{i,32}=6.0;
elseif Output{i,32}==2
Output{i,32}=5.0;
elseif Output{i,32}==3
Output{i,32}=4.0;
elseif Output{i,32}==4
Output{i,32}=3.0;
elseif Output{i,32}==5
Output{i,32}=2.0;
elseif Output{i,32}==6
Output{i,32}=1.0;
end
end
%Saving scored data
Scored_Data=cell2table(Output);
writetable(Scored_Data,'Scored SF-36 Data.xls');
%In Excel file, recode missing item responses with mean substitution
%where possible
%Save file as csv
%Uploading recoded SF-36 data
% filename=input('Please input the filename:','s');
filename='Scored SF-36 Data.csv';
opts = detectImportOptions(filename);
opts = setvartype(opts,'char'); % or 'string'
R = readtable(filename,opts);
C=table2cell(R);
R=[R.Properties.VariableNames;C];
R(1,:)=Output(1,:);
%Converting data type from string to double for mathematical functions
for i=2:rows
for j=3:cols
R{i,j}=str2double(R{i,j});
end
end
Scores=R;
%Creating cell vectors to store sub-scale data
%If more than 50% of scale items missing, sub-scale score not reported
%Physical Functioning
PF=cell(rows,1);
for i=2:rows
PF_data(i-1,:)=[Scores{i,5},Scores{i,6},Scores{i,7},Scores{i,8},...
Scores{i,9},Scores{i,10},Scores{i,11},Scores{i,12},...
Scores{i,13},Scores{i,14}];
nz=nnz(~PF_data(i-1,:));
if nz > 5
PF{i,1}=[];
else
PF{i,1}=Scores{i,5}+Scores{i,6}+Scores{i,7}+Scores{i,8}+Scores{i,9}...
+Scores{i,10}+Scores{i,11}+Scores{i,12}+Scores{i,13}+Scores{i,14};
end
end
%Role Limitations due to Physical Health
RP=cell(rows,1);
for i=2:rows
RP_data(i-1,:)=[Scores{i,15},Scores{i,16},Scores{i,17},Scores{i,18}];
nz=nnz(~RP_data(i-1,:));
if nz > 2
PF{i,1}=[];
else
RP{i,1}=Scores{i,15}+Scores{i,16}+Scores{i,17}+Scores{i,18};
end
end
%Bodily Pain
BP=cell(rows,1);
for i=2:rows
BP_data(i-1,:)=[Scores{i,23},Scores{i,24}];
nz=nnz(~BP_data(i-1,:));
if nz > 1
PF{i,1}=[];
else
BP{i,1}=Scores{i,23}+Scores{i,24};
end
end
%General Health
GH=cell(rows,1);
for i=2:rows
GH_data(i-1,:)=[Scores{i,3},Scores{i,35},Scores{i,36},Scores{i,37},Scores{i,38}];
nz=nnz(~GH_data(i-1,:));
if nz > 2
PF{i,1}=[];
else
GH{i,1}=Scores{i,3}+Scores{i,35}+Scores{i,36}+Scores{i,37}+Scores{i,38};
end
end
%Vitality (Energy/Fatigue)
VI=cell(rows,1);
for i=2:rows
VI_data(i-1,:)=[Scores{i,25},Scores{i,29},Scores{i,31},Scores{i,33}];
nz=nnz(~VI_data(i-1,:));
if nz > 2
VI{i,1}=[];
else
VI{i,1}=Scores{i,25}+Scores{i,29}+Scores{i,31}+Scores{i,33};
end
end
%Social Functioning
SF=cell(rows,1);
for i=2:rows
SF_data(i-1,:)=[Scores{i,22},Scores{i,34}];
nz=nnz(~SF_data(i-1,:));
if nz > 1
SF{i,1}=[];
else
SF{i,1}=Scores{i,22}+Scores{i,34};
end
end
%Role Limitations due to Emotional Health
RE=cell(rows,1);
for i=2:rows
RE_data(i-1,:)=[Scores{i,19},Scores{i,20},Scores{i,21}];
nz=nnz(~RE_data(i-1,:));
if nz > 1
RE{i,1}=[];
else
RE{i,1}=Scores{i,19}+Scores{i,20}+Scores{i,21};
end
end
%Mental Health
MH=cell(rows,1);
for i=2:rows
MH_data(i-1,:)=[Scores{i,26},Scores{i,27},Scores{i,28},Scores{i,30},Scores{i,32}];
nz=nnz(~MH_data(i-1,:));
if nz > 2
MH{i,1}=[];
else
MH{i,1}=Scores{i,26}+Scores{i,27}+Scores{i,28}+Scores{i,30}+Scores{i,32};
end
end
%Reported Health Transition, not used in Physical Component Score or
%Mental Component Score
RHT=cell(rows,1);
for i=2:rows
RHT_data(i-1,:)=[Scores{i,4}];
nz=nnz(~RHT_data(i-1,:));
if nz > 0
MH{i,1}=[];
else
RHT{i,1}=Scores{i,4};
end
end
%Transform raw scores to 0-100 scale
%Storing min/max/range of each domain scores
[minPF,maxPF]=bounds(cell2mat(PF));
rangePF=maxPF-minPF;
[minRP,maxRP]=bounds(cell2mat(RP));
rangeRP=maxRP-minRP;
[minBP,maxBP]=bounds(cell2mat(BP));
rangeBP=maxBP-minBP;
[minGH,maxGH]=bounds(cell2mat(GH));
rangeGH=maxGH-minGH;
[minVI,maxVI]=bounds(cell2mat(VI));
rangeVI=maxVI-minVI;
[minSF,maxSF]=bounds(cell2mat(SF));
rangeSF=maxSF-minSF;
[minRE,maxRE]=bounds(cell2mat(RE));
rangeRE=maxRE-minRE;
[minMH,maxMH]=bounds(cell2mat(MH));
rangeMH=maxMH-minMH;
%Calculating transformed scores
%transformed score = [(actual raw score - min)/range]*100
PF_transform=cell(rows,1);
for i=2:rows
PF_transform{i,1}=((PF{i,1}-minPF)/rangePF)*100;
end
RP_transform=cell(rows,1);
for i=2:rows
RP_transform{i,1}=((RP{i,1}-minRP)/rangeRP)*100;
end
BP_transform=cell(rows,1);
for i=2:rows
BP_transform{i,1}=((BP{i,1}-minBP)/rangeBP)*100;
end
GH_transform=cell(rows,1);
for i=2:rows
GH_transform{i,1}=((GH{i,1}-minGH)/rangeGH)*100;
end
VI_transform=cell(rows,1);
for i=2:rows
VI_transform{i,1}=((VI{i,1}-minVI)/rangeVI)*100;
end
SF_transform=cell(rows,1);
for i=2:rows
SF_transform{i,1}=((SF{i,1}-minSF)/rangeSF)*100;
end
RE_transform=cell(rows,1);
for i=2:rows
RE_transform{i,1}=((RE{i,1}-minRE)/rangeRE)*100;
end
MH_transform=cell(rows,1);
for i=2:rows
MH_transform{i,1}=((MH{i,1}-minMH)/rangeMH)*100;
end
R(:,39)=PF_transform(:,1);
R{1,39}='Physical Functioning';
R(:,40)=RP_transform(:,1);
R{1,40}='Role-Physical';
R(:,41)=BP_transform(:,1);
R{1,41}='Bodily Pain';
R(:,42)=GH_transform(:,1);
R{1,42}='General Health';
R(:,43)=VI_transform(:,1);
R{1,43}='Vitality';
R(:,44)=SF_transform(:,1);
R{1,44}='Social Functioning';
R(:,45)=RE_transform(:,1);
R{1,45}='Role-Emotional';
R(:,46)=MH_transform(:,1);
R{1,46}='Mental Health';
%PCS/MCS Computation
%Step 1: Perform z-score standardization of SF-36 scales
PF_Z=cell(rows,1);
RP_Z=cell(rows,1);
BP_Z=cell(rows,1);
GH_Z=cell(rows,1);
VI_Z=cell(rows,1);
SF_Z=cell(rows,1);
RE_Z=cell(rows,1);
MH_Z=cell(rows,1);
for i=2:rows
PF_Z{i,1}=((PF_transform{i,1}-84.52404)/22.89490);
RP_Z{i,1}=((RP_transform{i,1}-81.19907)/33.79729);
BP_Z{i,1}=((BP_transform{i,1}-75.49196)/23.55879);
GH_Z{i,1}=((GH_transform{i,1}-72.21316)/20.16964);
VI_Z{i,1}=((VI_transform{i,1}-61.05453)/20.86942);
SF_Z{i,1}=((SF_transform{i,1}-83.59753)/22.37642);
RE_Z{i,1}=((RE_transform{i,1}-81.29467)/33.02717);
MH_Z{i,1}=((MH_transform{i,1}-74.84212)/18.01189);
end
%Aggregation of scale scores into PCS/MCS
agg_phys=cell(rows,1);
agg_ment=cell(rows,1);
for i=2:rows
agg_phys{i,1}=(PF_Z{i,1}*.42402)+(RP_Z{i,1}*.35119)+(BP_Z{i,1}*.31754)...
+(GH_Z{i,1}*.24954)+(VI_Z{i,1}*.02877)+(SF_Z{i,1}*-.00753)+...
(RE_Z{i,1}*-.19206)+(MH_Z{i,1}*-.22069);
agg_ment{i,1}=(PF_Z{i,1}*-.22999)+(RP_Z{i,1}*-.12329)+(BP_Z{i,1}*-.09731)...
+(GH_Z{i,1}*-.01571)+(VI_Z{i,1}*.23534)+(SF_Z{i,1}*.26876)+(RE_Z{i,1}*.43407)...
+(MH_Z{i,1}*.48581);
end
%T-score transformation of PCS/MCS
t_pcs=cell(rows,1);
t_mcs=cell(rows,1);
for i=2:rows
t_pcs{i,1}=50+(agg_phys{i,1}*10);
t_mcs{i,1}=50+(agg_ment{i,1}*10);
end
R(:,47)=t_pcs(:,1);
R{1,47}='Physical Component Score';
R(:,48)=t_mcs(:,1);
R{1,48}='Mental Component Score';
%Saving scored data with PCS/MCS
Scored_Data=cell2table(R);
writetable(Scored_Data,'SF-36 Data PCS MCS.xls');
SIP Dysfunction Score
%Uploading raw SIP data
filename=input('Please input the filename, including the .csv extension:','s');
opts = detectImportOptions(filename);
opts = setvartype(opts,'char');
T = readtable(filename,opts);
C=table2cell(T);
T=[T.Properties.VariableNames;C];
tf = cellfun('isempty',T); % true for empty cells
T(tf) = {'0'};
[rows, cols]=size(T);
%Converting data type from string to double for mathematical functions
for i=2:rows
for j=3:cols
T{i,j}=str2double(T{i,j});
end
end
%Reformatting Output data table
Output=T;
%Looping through raw data by item (row)
%Replacing checked items with the scaled value, replacing unchecked items with zero
for i=2:rows
j=3;
% 083
if isequal(T{i,j},1)
Output{i,j}=8.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 049
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 104
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=10.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 058
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 084
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 061
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.1;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 060
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.0;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 087
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 068
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 069
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 132
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=13.2;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 046
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 062
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.2;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 078
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 089
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 074
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 084
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 121
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=12.1;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 072
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.2;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 098
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=9.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 064
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 100
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=10.0;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 064
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 125
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=12.5;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 058
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 082
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.2;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 113
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=11.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 030
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=3.0;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 086
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 089
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 115
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=11.5;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 114
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=11.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 057
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 124
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=12.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 074
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 074
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 128
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=12.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 043
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 088
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 054
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 044
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 086
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 062
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.2;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 071
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.1;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 077
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 069
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 077
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 044
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 084
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 086
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 106
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=10.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 081
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.1;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 109
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=10.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 041
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.1;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 066
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 056
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 048
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 054
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 072
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.2;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 044
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 101
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=10.1;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 067
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 084
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 052
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.2;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 036
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=3.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 043
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 080
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.0;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 051
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.1;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 052
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.2;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 056
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 088
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 086
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 088
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 119
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=11.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 102
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=10.2;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 064
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 115
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=11.5;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 079
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 043
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 048
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 056
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 067
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 076
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 096
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=9.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 105
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=10.5;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 055
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.5;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 088
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 054
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 083
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 079
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 035
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=3.5;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 090
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=9.0;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 075
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.5;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 059
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 067
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 084
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 113
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=11.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 078
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.8;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 067
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 064
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 080
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.0;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 070
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.0;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 102
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=10.2;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 093
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=9.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 083
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 083
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 067
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 076
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 087
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 064
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 361
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=36.1;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 037
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=3.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 055
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.5;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 080
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.0;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 043
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 050
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.0;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 061
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.1;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 034
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=3.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 062
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=6.2;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 039
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=3.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 036
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=3.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 059
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 084
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=8.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 051
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.1;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 033
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=3.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 043
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 077
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 037
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=3.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 077
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=7.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 043
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=4.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 104
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=10.4;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 059
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=5.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 036
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=3.6;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 099
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=9.9;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 117
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=11.7;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
% 133
j=j+1;
if isequal(T{i,j},1)
Output{i,j}=13.3;
elseif isequal(T{i,j},2)
Output{i,j}=0;
end
end
%Isolate numerical data
Scores=cell(rows-1,cols-2);
for i=2:rows
for j=3:cols
Scores{i-1,j-2}=Output{i,j};
end
end
Scores=cell2mat(Scores);
sum_scores=sum(Scores,2);
dysfunction_score=zeros(rows-1,1);
dysfunction_score(:,1)=(sum_scores./1003).*100;
dysfunction_score=num2cell(dysfunction_score);
dysfunction_score_reformatted=cell(rows,1);
dysfunction_score_reformatted{1,1}='Dysfunction Score';
dysfunction_score_reformatted(2:end,1)=dysfunction_score;
Output(:,cols+1)=dysfunction_score_reformatted;
%Creating Excel sheet including relevant data
patient_info(:,1)=Output(2:end,1);
patient_info(:,2)=Output(2:end,2);
Headers={'Record ID','Time Point','Calculated Dysfunction Score (%)'};
S=[patient_info,dysfunction_score];
S=cell2table(S, 'VariableNames', Headers);
writetable(S,'SIP Dysfunction Score.xls')