-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateData_R_analysis.m
More file actions
78 lines (54 loc) · 1.67 KB
/
createData_R_analysis.m
File metadata and controls
78 lines (54 loc) · 1.67 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
%% Make structure for multi-class logistic regression in R (from raw spikes)
response = [];
z = [];
ctr = 1;
for sessionNum = 1:4
for trialNum = 1:5
for task = 1:8
v = struct_rawSpikeData{sessionNum, task, trialNum};
if (length(v) ~=0)
z = vertcat(v',z);
response(ctr:ctr+size(v,2)-1) = repmat(task,1,size(v,2));
ctr = ctr + size(v,2);
end
end
end
end
save('data_regression.mat','z')
save('Response.mat','response')
%% Make structure for multi-class logistic regression in R (from latent model (after FA))
response = [];
z = [];
ctr = 1;
for sessionNum = 1:1
for trialNum = 1:14
for task = 1:8
v = struct_xorth{sessionNum, task, trialNum};
if (length(v) ~=0)
z = vertcat(v',z);
response(ctr:ctr+size(v,2)-1) = repmat(task,1,size(v,2));
ctr = ctr + size(v,2);
end
end
end
end
save('data_regression.mat','z')
save('Response.mat','response')
%% Make structure for multi-class logistic regression (across time) in R (from latent model (after FA))
response = [];
z = [];
ctr = 1;
for sessionNum = 1:1
for trialNum = 1:14
for task = 1:8
v = struct_xorth{sessionNum, task, trialNum};
if (length(v) ~=0)
z = vertcat(v(:,1:60),z);
response(ctr:ctr+size(v,1)-1) = repmat(task,1,size(v,1));
ctr = ctr + size(v,1);
end
end
end
end
save('data_regression.mat','z')
save('Response.mat','response')