One Sided T test function gives -Inf as part of the confidence interval?
조회 수: 21 (최근 30일)
이전 댓글 표시
As the question states, I have a problem where I need to use the 'ttest' function.
I have the data,
data = [37 , 54 , 29 , 46 , 33];
then I run the test:
[h , p , ci , stat] = ttest(data , 45 , 'Alpha' , 0.10 , 'Tail' , 'left');
I get:
h = 0; p = 0.158; ci = -Inf 49.4618; stats = tstat: -1.1474; df: 4; sd: 10.1341;
Everything is correct from hand calculations, except for the -Inf value as the lower limit on the confidence interval. I looked for help with this before posting, and a previous post (<http://stackoverflow.com/questions/3816702/ttest-function-error-in-matlab-error-using-nanmean-too-many-input>) about an unrelated issue with ttest suggested using "which" to verify the correct function is being used.
When I do that, I get:
C:\Program Files\MATLAB\R2013a\toolbox\stats\stats\ttest.m
I don't know if this is a flaw with the function or something else. The script is attached.
댓글 수: 0
채택된 답변
the cyclist
2013년 10월 14일
The result is correct. You have asked for a one-sided test. The null hypothesis is that the mean of the data is 45. The alternate hypothesis is that the data come from a distribution with mean less than 45.
The test did not reject the null (h =0), and the 90% confidence interval is that the mean is less than 49.4618, which equivalent to saying it is in the interval [-Inf,49.4618].
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Hypothesis Tests에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!