-
Notifications
You must be signed in to change notification settings - Fork 2
/
fig_analyze.m
116 lines (115 loc) · 4.67 KB
/
fig_analyze.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
function [] = fig_analyze(X, Y, filenames, labelX, labelY, mag)
%FIG_ANALYZE Window for the display of rating statistics
% License: https://github.com/jmgirard/DARMA/blob/master/LICENSE.txt
if isempty(X), return; end
defaultBackground = get(0,'defaultUicontrolBackgroundColor');
handles.figure_analyze = figure( ...
'Name','DARMA: Analyze Ratings', ...
'Units','pixels', ...
'Position',[0 0 500 550], ...
'NumberTitle','off', ...
'MenuBar','none', ...
'ToolBar','none', ...
'Visible','off', ...
'Resize','off', ...
'Color',defaultBackground);
movegui(handles.figure_analyze,'center');
uicontrol('Style','text', ...
'Parent',handles.figure_analyze, ...
'Units','normalized', ...
'Position',[.05 .925 .90 .04], ...
'HorizontalAlignment','center', ...
'FontSize',12, ...
'String','Axis Configuration');
handles.configuration = uitable(...
'Parent',handles.figure_analyze, ...
'Units','normalized', ...
'Position',[.05 .800 .90 .10], ...
'ColumnName',{'X-Axis Label','Y-Axis Label','Axis Magnitude'}, ...
'ColumnWidth',{150,150,148.5}, ...
'RowName',[], ...
'Data',{labelX,labelY,mag}, ...
'FontSize',11);
jscrollpane = findjobj(handles.configuration);
jTable = jscrollpane.getViewport.getView;
cellStyle = jTable.getCellStyleAt(0,0);
cellStyle.setHorizontalAlignment(cellStyle.CENTER);
jTable.repaint;
uicontrol('Style','text', ...
'Parent',handles.figure_analyze, ...
'Units','normalized', ...
'Position',[.05 .72 .90 .04], ...
'HorizontalAlignment','center', ...
'FontSize',12, ...
'String','Descriptive Statistics');
handles.descriptives = uitable(...
'Parent',handles.figure_analyze, ...
'Units','normalized', ...
'Position',[.05 .42 .90 .275], ...
'ColumnName',{'Annotation File','X Mean','X SD','Y Mean','Y SD'}, ...
'ColumnWidth',{143,72,72,72,72}, ...
'RowName',[], ...
'Data',[], ...
'FontSize',10);
set(findjobj(handles.descriptives),'VerticalScrollBarPolicy',javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
% Reliability Table
uicontrol('Style','text', ...
'Parent',handles.figure_analyze, ...
'Units','normalized', ...
'Position',[.05 .35 .90 .04], ...
'HorizontalAlignment','center', ...
'FontSize',12, ...
'String','Inter-Rater Agreement and Reliability');
handles.reliability = uitable(...
'Parent',handles.figure_analyze, ...
'Units','normalized', ...
'Position',[.05 .05 .90 .275], ...
'ColumnName',{'Index of Agreement/Reliability','X-Axis','Y-Axis'}, ...
'ColumnWidth',{230,109,109}, ...
'RowName',[], ...
'Data',[], ...
'FontSize',10);
index = any(isnan(X),2);
X2 = X;
Y2 = Y;
X2(index,:) = [];
Y2(index,:) = [];
r = size(X2,2);
% Calculate and display descriptives
desc = get(handles.descriptives,'Data');
for i = 1:r
desc{i,1} = filenames{i};
desc{i,2} = num2str(nanmean(X(:,i)),'%.3f');
desc{i,3} = num2str(nanstd(X(:,i)),'%.3f');
desc{i,4} = num2str(nanmean(Y(:,i)),'%.3f');
desc{i,5} = num2str(nanstd(Y(:,i)),'%.3f');
end
set(handles.descriptives,'Data',desc);
% Calculate and display reliability
if r == 1
reli = [];
elseif r > 1
reli{1,1} = ' Single-Score Agreement ICC';
reli{1,2} = num2str(ICC_A_1(X2),'%0.3f');
reli{1,3} = num2str(ICC_A_1(Y2),'%0.3f');
reli{2,1} = ' Single-Score Consistency ICC';
reli{2,2} = num2str(ICC_C_1(X2),'%0.3f');
reli{2,3} = num2str(ICC_C_1(Y2),'%0.3f');
reli{3,1} = ' Average-Score Agreement ICC';
reli{3,2} = num2str(ICC_A_k(X2),'%0.3f');
reli{3,3} = num2str(ICC_A_k(Y2),'%0.3f');
reli{4,1} = ' Average-Score Consistency ICC';
reli{4,2} = num2str(ICC_C_k(X2),'%0.3f');
reli{4,3} = num2str(ICC_C_k(Y2),'%0.3f');
reli{5,1} = ' Mean of Rectangular RWG scores';
reli{5,2} = num2str(RWG(round(X2),2*mag,'uniform'),'%0.3f');
reli{5,3} = num2str(RWG(round(Y2),2*mag,'uniform'),'%0.3f');
reli{6,1} = ' Mean of Triangular RWG scores';
reli{6,2} = num2str(RWG(round(X2),2*mag,'triangular'),'%0.3f');
reli{6,3} = num2str(RWG(round(Y2),2*mag,'triangular'),'%0.3f');
else
return;
end
set(handles.reliability,'Data',reli);
set(handles.figure_analyze,'Visible','on');
end