F検定について
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hiraku Tokuma
le 29 Sep 2021
Commenté : Hiraku Tokuma
le 2 Oct 2021
forループでF検定のp値を出力させる方法を教えてください。
for a= 1:n;
x= 行列名1 (a,:);
y = 行列名2(a,:);
f(a,:) = vartest2(x,y);
end
とすると、
行列名1と2のa列目同士をF検定してその判定を返してはくれるのですが、同時にp値の行列も作成したいです。
ご知恵を拝借願えませんでしょうか。
0 commentaires
Réponse acceptée
Atsushi Ueno
le 29 Sep 2021
上記の最初に書いてある「等分散に関する検定」と同じ内容です。データの内容はさておき、[h,p] = vartest2(x,y)と書かないとp値を出力してくれないので、一旦スカラ変数に格納してから行列にコピーすればやりたい事が出来ます。
load examgrades;
for a= 1:size(grades,2)-1;
x = grades(:,a);
y = grades(:,a+1);
[h,p] = vartest2(x,y) % 検定結果とp値を両方出力する
f(a,:) = [h,p]; % 検定結果とp値を行列に格納する
end
f
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 仮説検定 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!