Two outputs when calculating standard error of mean, WHY?

조회 수: 3 (최근 30일)
Vlatko Milic
Vlatko Milic 2019년 11월 7일
댓글: Daniel M 2019년 11월 7일
Hi,
I am calculating the standard error of the mean and I am getting two ouput. I do not understand why. The code is:
SEM_A = std(A,[])./ sqrt(size(A))
And my output is:
SEM_A =
0.0048 0.1290
Do You have any ideas?
:)

채택된 답변

Daniel M
Daniel M 2019년 11월 7일
편집: Daniel M 2019년 11월 7일
It's because size(A) returns two outputs. If you want to use the size of A in a particular dimension, use size(A,dim). (Since size operates columnwise, it's likely only dim=2 would make sense). If you want to divide by the total number of elements in A, use numel(A). If A is a vector then numel(A) is the same as length(A), which is the same as max(size(A)).
  댓글 수: 3
Vlatko Milic
Vlatko Milic 2019년 11월 7일
Now I think I solved it. My code is now:
STE = std(stat_W_per_K)./ sqrt(size(stat_W_per_K,2));
However, when it was:
STE = std(stat_W_per_K)./ sqrt(length(stat_W_per_K));
I got the super-low values. What is the reason for this?
Lastly, do you know how I can connect the standard error to a confidence interval of 95%? Is it my average +- my standard error and that's it? :)
Regards, Vlatko
Daniel M
Daniel M 2019년 11월 7일
Again it is the difference between the output of length(A) and size(A,2). I can't tell you which one is correct.
I also can't tell you how else to analyze/report your data, because I don't know what they are, how they were measured, underlying assumptions, statistical distributions, systematic errors and uncertainty, etc.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by