How do I do SEM Error Bars?

100 views (last 30 days)
Delany MacDonald
Delany MacDonald on 1 Apr 2016
Commented: Star Strider on 7 Nov 2019
I know how to find the standard deviation with error bars but how do I find the standard error mean of variables?

Accepted Answer

Star Strider
Star Strider on 1 Apr 2016
You have to know the number of observations that went into calculating each standard deviation.
Assuming ‘x’ is a vector:
SEM = std(x)/sqrt(length(x));
  4 Comments
Vlatko Milic
Vlatko Milic on 7 Nov 2019
Hi,
I get two outputs when calculating the standard error according to your example. What can the reason for this be?
Kind regards
Star Strider
Star Strider on 7 Nov 2019
My code calculates ±95% confidence limits, so it produces both limits.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!