I know how to find the standard deviation with error bars but how do I find the standard error mean of variables?

 Respuesta aceptada

Star Strider
Star Strider el 1 de Abr. de 2016

5 votos

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 comentarios

Delany MacDonald
Delany MacDonald el 1 de Abr. de 2016
So if it's a 21 x 345 array and I find the mean over the 21 days would it be A =21 x 345 SEM = std(A)/sqrt(length(A));
Star Strider
Star Strider el 1 de Abr. de 2016
Not quite. You have to change that a bit to calculate along the rows:
A = randi(99, 21, 345); % Create Data
SEM_A = std(A, [], 2)./ sqrt(size(A,2)); % Calculate Standard Error Of The Mean
CI95 = bsxfun(@plus, mean(A,2), bsxfun(@times, [-1 1]*1.96, SEM_A)); % 95% Confidence Intervals
I tossed in the 95% confidence interval calculation for free!
Vlatko Milic
Vlatko Milic el 7 de Nov. de 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 el 7 de Nov. de 2019
My code calculates ±95% confidence limits, so it produces both limits.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 1 de Abr. de 2016

Comentada:

el 7 de Nov. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by