Type II Errors—Counting and Calculating Probability

2 views (last 30 days)
I have 10 randomly distributed pseudorandom numbers,
r = 10.5 + 1.*randn(1,10);
and I've calculated the t-test over a 95% confidence level
[h,p,ci,stats]=ttest(r,10)
I need to run this 1000 times and identify how many times a type II error is committed. Is there a way to do this in MATLAB?
Lastly I have to calculate the power of the t-test with n=10 against the alternative hypothesis where mu=10.5 (where as the last was 10), I'm not quite sure how to do that. Do I set up another t-test,
[h2,p2,ci2,stats2]=ttest(r,10.5)
and use this somehow?
Thanks.

Answers (0)

Community Treasure Hunt

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

Start Hunting!