Ttest problem with alpha

7 ビュー (過去 30 日間)
curoi
curoi 2013 年 4 月 9 日
コメント済み: Triana Anderson 2022 年 10 月 13 日
So I'm trying to run a one-sample test so that I can determine the confidence intervals at one standard deviation away. However I keep getting the error 'ALPHA must be a scalar between 0 and 1' for the following code.
[ ho1, pv1, ci1, stat1 ] = ttest( New_cor.h, mean( New_cor.h ),'Alpha', 0.32 );
I've tried replacing the 0.32 with other values between 0 and 1 including 0.05 and 0.01 but I still get the same error. If I don't include 'Alpha' and run the ttest as the default 0.05, it works. Any ideas?

採用された回答

bym
bym 2013 年 4 月 9 日
you do not need to pass 'Alpha' to the function, you are getting the error because you are trying to pass a string when it is expecting a number. Just do this:
[ ho1, pv1, ci1, stat1 ] = ttest( New_cor.h, mean( New_cor.h ), 0.32 );
  1 件のコメント
Triana Anderson
Triana Anderson 2022 年 10 月 13 日
I am having a smilar problem as the one above. I tried this solution and get an error that says:
'.05' is not a valid value for the 'tail' argument. Valid values are: 'left', 'both', 'right'.
I am trying to run this test:
[h,p,ci,stats] = ttest(x, 12.6, .4, 'tail', 'right', 'alpha', 0.01)
and I get the response:
'tail' is not a valid value for the 'tail' argument. Valid values are: 'left', 'both','right'.
If I try running it:
[h,p,ci,stats] = ttest(x, 12.6, .4, 'right', 'alpha', 0.01)
I get: Dimension argument must be a positive integer scalar or a vector of positive integers.
If I run it:
[h,p,ci,stats] = ttest(x, 12.6, .4, 'right')
I get results... but I want to be able to set the significnace level.
If I run it:
[h,p,ci,stats] = ttest(x, 12.6, .4, 'right', 'alpha', .01)
I get: Error using size
Dimension argument must be a positive integer scalar or a vector of positive integers.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHypothesis Tests についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by