Group Abstract Group Abstract

Message Boards Message Boards

Implementing a function to determine the standard error?

Posted 5 years ago
POSTED BY: Ion Ganea
7 Replies
Posted 5 years ago

You have a few errors in the code.

  • The definition of coeficientOfVariation[val_] is missing an additional f.
  • Sqrt[val["PathLength"]] should be Sqrt[Length[val]].
  • Mean[val["PathLength"]] should be Mean[val].
POSTED BY: Jim Baldwin
Posted 5 years ago
POSTED BY: Ion Ganea
Posted 5 years ago

It is not so obvious what your data are:)

Lets say you have computed your mean data and errors to be:

mean = {7.43, 8.83, 6.06, 13.8};
errors = {4, 3, 2, 1};

then you wrap Around to your data:

data = Apply[Around, Transpose[{mean, errors}], 1];

and BarChart it:

BarChart[data, ChartElementFunction -> "GlassRectangle", 
 ChartStyle -> "Pastel"]

which gives:

enter image description here

POSTED BY: Oliver Seipel
Posted 5 years ago

The lines indicating the error are not the same as the error. The errors have different values while the lines are all the same.

POSTED BY: Ion Ganea
Posted 5 years ago

One way to include error bars in BarChart is with Around:

standardError[val_] := StandardDeviation[val]/Sqrt[Length[val]]
LRed = {7.43, 8.83, 6.06, 13.8};
stdErr = standardError[LRed];
LRedAround = Map[Around[#, stdErr] &, LRed];
BarChart[LRedAround, ChartElementFunction -> "GlassRectangle", 
 ChartStyle -> "Pastel"]

which gives: enter image description here

POSTED BY: Oliver Seipel
Posted 5 years ago

The functions standardError and coefficientOfVariation were evaluated.

POSTED BY: Ion Ganea
Posted 5 years ago

Out[28] and Out[29] have not evaluated standardError and coefficientOfVariation which means those functions have not been defined. Did you evaluate the cells that contain the definition?

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard