There are generally two types of standard deviation calculations, one for when your data represents a sample of the population, and one where it represents the whole population. The former divides the squared deviations by N-1 (the sample count minus 1), whereas the latter divides by N.
As pryrt points out, you can get Statistics::Basic to do both by setting UNBIAS to true, whereas Statistics::Lite gives you two separate functions. Note also that Statistics::Basic defaults to a precision of 2 decimal points - this can be changed by setting IPRES to the desired precision.
Just for fun I did a little comparison table:
Excel |
STDEV |
0.41068873 |
STDEVP |
0.400791162 |
Open Office |
STDEV |
0.4106887305 |
STDEVP |
0.400791162 |
Statistics::Lite |
stddev() |
0.410688730467897 |
stddevp() |
0.400791162022762 |
Statistics::Basic |
stddev()
UNBIAS true |
0.410688730467897 |
stddev() |
0.400791162022762 |
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|