-
Notifications
You must be signed in to change notification settings - Fork 1
/
doStatisticsGroupWOmed.m
77 lines (64 loc) · 2.91 KB
/
doStatisticsGroupWOmed.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
%calculate t-test-statistics from edf files, returns several xls files and graphic
clear;
%import necessary functions
d = functionsForTUHData;
funcEEGData = visualizeEEGData;
funcEDF = functionsForEDFFiles;
%change folders and drug group
drive="D:/Results/t-test/drug groups/";
driveS="D:/Results/t-test/single drugs/";
group="AP";
group="AED";
if group == "AP"
meds=["Risperidone", "Olanzapine", "Quetiapine", "Aripiprazole", "Ziprasidone", "Haloperidol", "Clozapin"];%no files for Amisulpride, Paliperidone
meds=["Risperidone"];
elseif group == "AD"
meds = ["Escitalopram", "Sertraline", "Paroxetine", "Fluoxetine", "Bupropion", "Venlafaxine", "Trazodone"];
elseif group == "AED"
meds=["Valproate", "Lamotrigine", "Carbamazepine", "Topiramate", "Levetiracetam"];
meds=["Carbamazepine"];
elseif group == "BDZ"
meds = ["Lorazepam", "Clonazepam", "Diazepam", "Alprazolam"];
end
singleDrug=true;%only use files with single drug intake (only one drug from our list)
for i=1:length(meds)
medicine = strcat(meds(i));
disp(medicine);
fileMeds = strcat(driveS,"Powerspectrum/",medicine,'_powerspectrumAverage.xls');%
if singleDrug == true
fileMeds = strcat(driveS,"Powerspectrum/",medicine,'_powerspectrumAverageSingleDrug.xls');%
end
fileGroup = strcat(drive,"Powerspectrum/",group,'WO',medicine,'_powerspectrumAverage.xls');
%read data into Matlab
%created with prepareData.m
dataNormal = readtable(fileGroup);
data = readtable(fileMeds);
%calculate statistics
path=strcat(driveS,"StatisticsGroup/");
if singleDrug == true
path=strcat(driveS,"StatisticsSingle/");
end
filenameGroup=strcat(group,'WO',medicine);
%funcEEGData.calcPValueAndMore(dataNormal, data, medicine, path, filenameGroup);
%created in calcPValueAndMore
filename = strcat(path, medicine, '_', filenameGroup, '_data.xls');
data = readcell(filename);
%visualize previously created data and saves figure
%visualizePValues(dataPValue, bAT, bAbsolut, sFigureName)
% bAbsolut adjust function for absolut or relative value output
savepath=strcat(driveS,"FiguresGroup/");
imageTitle = strcat(medicine, {' vs '},group,' - Absolute');
if singleDrug == true
imageTitle = strcat(medicine, {' vs '},group,' - Absolute, single drug');
end
funcEEGData.visualizePValues(data, true, imageTitle, savepath, false, group);
%with bonferoni correction for multiple tests
funcEEGData.visualizePValues(data, true, imageTitle, savepath, true, group);
imageTitle = strcat(medicine, {' vs '},group,' - Relative');
if singleDrug == true
imageTitle = strcat(medicine, {' vs '},group,' - Relative, single drug');
end
funcEEGData.visualizePValues(data, false, imageTitle, savepath, false, group);
%with bonferoni correction for multiple tests
funcEEGData.visualizePValues(data, false, imageTitle, savepath, true, group);
end