how do I input a one-way anova function?

I have 4 sample sizes. The first one has 11 observations, the second and fourth ones have 9 and the third one has 8. I am told that as inputs I have to include these 4 samples and the level of significance which in this case is 0.05. How do i make this function in such a way that gives me one-way anova results please?
Thank you in advance

回答 (1 件)

Jeff Miller
Jeff Miller 2022 年 5 月 27 日

0 投票

scores = []; % list the 37 scores inside the brackets, all of group 1 first, then group 2, etc
group = {'a' 'a' 'a' } % list 37 group codes, i.e. 11 a's for group 1, then 9 'b's for group 2, etc
[p,tbl,stats] = anova1(scores,group);
The p value is part of the output and you can just check whether it is less than 0.05

3 件のコメント

Valentina Richard
Valentina Richard 2022 年 5 月 28 日
Hi Jeff, thank you so much for your reply.
Is there a way to use the 'if' operator with regards to the acception/rejection of null hypothesis please?
Jeff Miller
Jeff Miller 2022 年 5 月 29 日
Please accept my answer if it has given you the anova results you were after.
For conditioning on the test result, you can use for example
rejectH0 = p<0.05;
if rejectH0
% commands if H0 rejected
else
% commands if H0 not rejected
end
Valentina Richard
Valentina Richard 2022 年 5 月 31 日
I will let you know when I try it out. Many thanks

サインインしてコメントする。

カテゴリ

タグ

質問済み:

2022 年 5 月 27 日

コメント済み:

2022 年 5 月 31 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by