-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataFilter.m
More file actions
64 lines (55 loc) · 1.4 KB
/
Copy pathdataFilter.m
File metadata and controls
64 lines (55 loc) · 1.4 KB
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: dataFilter
% Purpose: Define a filter for the data
%
% Parameters:
% data: data structure
% opt: data options
%
% Output:
% f: filter
%
% ************************************************************************
function f = dataFilter( data, opt )
f = true( length( data.outcome ), 1 );
% sample size
if opt.doReduceSample
opt.method = opt.reducedSampleMethod; % put it in correct structure
opt.kFolds = 0;
f = partitionData( data.outcome, data.subject, opt );
%disp(['Sample size = ' num2str(sum(f)) ]);
end
% jump type
switch opt.arms
case 'No Arms'
f = f & ~data.withArms;
case 'With Arms'
f = f & data.withArms;
end
% sex
switch opt.sex
case 'Male'
f = f & data.sex=={'Male'};
case 'Female'
f = f & data.sex=={'Female'};
end
% performance level
switch opt.perfLevel
case 'Low'
f = f & data.perfLevel==1;
case 'Intermediate'
f = f & data.perfLevel==2;
case 'High'
f = f & data.perfLevel==3;
end
% extra jumps
if isfield( opt, 'doIncludeExtraJumps' )
if ~opt.doIncludeExtraJumps
f = logical([f(1:219)' ...
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 ...
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 ...
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 ...
0 0 0 0 0 0 0 0 ]');
end
end
end