%Load data and make variables
%%
load('../Data/StudData2014.txt')

hogde=StudData2014(:,1);
hogdeMor=StudData2014(:,2);
hogdeFar=StudData2014(:,3);
kjonn=StudData2014(:,4);
har=StudData2014(:,5);
auge=StudData2014(:,6);
Matlab=StudData2014(:,7);


%Make vectors with hight of men and women

indexMann=find(kjonn==1);
indexKvinne=find(kjonn==2);
hogdeMann=hogde(indexMann);
hogdeKvinne=hogde(indexKvinne);

mean(hogdeKvinne)

%% Hypotesetest, eit utvalg kjent varians (std=6.0)

[h,p,ci,z]=ztest(hogdeKvinne,172,6,0.05,'left')

%% Hypotesetest, eit utvalg ukjent varians 

[h,p,ci,t]=ttest(hogdeKvinne,172,0.05,'left')


%% test for to utval, ukjent lik varians (kvinner < menn)

[h,p,ci,t]=ttest2(hogdeKvinne,hogdeMann,0.05,'left', 'equal')

%% test for to utval, ukjent ulik varians (kvinner < menn)

[h,p,ci,t]=ttest2(hogdeKvinne,hogdeMann,0.05,'left', 'unequal')