3群比較などの検定を行う時に使うのがANOVA解析。
p = anova1(X)
p = anova1(X,group)
p = anova1(X,group,displayopt)
[p,table] = anova1(...)
[p,table,stats] = anova1(...)
行列Xは(サンプルX群)で入力する。
p値が十分小さければ、群間の平均は等しくなく、有意差があることになる。
その後、post hocテストで正式に有意差を示すことができる(ここを参照)。
multcompare
という関数にstatsを入力すればOKらしい。
(例)
[p t st]=anova1(X,{'50Hz','200Hz','800Hz'},'off');
[c,m,h,nms]=multcompare(st,'display','on');
[nms num2cell(m)]
MATLABのコードって忘れやすい・・・
プログラムのコマンドなんて忘れやすいもの・・・いっそのことネット上に保存してシェアしましょう!!
It's easy to forget command for MATLAB in programming.... Let's share small help for Matlab code with you on the web!!
It's easy to forget command for MATLAB in programming.... Let's share small help for Matlab code with you on the web!!
2010年10月6日水曜日
2010年9月21日火曜日
errorbar etc....
Matlab Centralを見ると、errorbarに関するコードが他にもこんなにあった。
http://www.mathworks.com/matlabcentral/fileexchange/27387-create-healthy-looking-error-bars
http://www.mathworks.com/matlabcentral/fileexchange/10803-barweb-bargraph-with-error-bars
http://www.mathworks.com/matlabcentral/fileexchange/27494
ってなわけで、これを試してみるべし。
http://www.mathworks.com/matlabcentral/fileexchange/27387-create-healthy-looking-error-bars
http://www.mathworks.com/matlabcentral/fileexchange/10803-barweb-bargraph-with-error-bars
http://www.mathworks.com/matlabcentral/fileexchange/27494
ってなわけで、これを試してみるべし。
paired t-test
[h1,p1]=ttest2(X,Y,0.05,'both','unequal')
h1=1ならベクトルX,Yに有意に差がある。
h0=0ならベクトルX,Yにp1の確率で差がない。
h1=1ならベクトルX,Yに有意に差がある。
h0=0ならベクトルX,Yにp1の確率で差がない。
登録:
投稿 (Atom)