From: John Darrington Date: Sat, 3 Mar 2012 11:05:17 +0000 (+0100) Subject: moments.c: Implement calc_semean. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e03970503d5ba427ada341596db8e55f5cd91fad;p=pspp moments.c: Implement calc_semean. This function was always declared, but never implemented. It's fairly trivial, but for consistency it makes sense to have here. --- diff --git a/src/math/moments.c b/src/math/moments.c index e289e8aec0..83cbbe4ca1 100644 --- a/src/math/moments.c +++ b/src/math/moments.c @@ -461,6 +461,13 @@ moments1_destroy (struct moments1 *m) free (m); } + +double +calc_semean (double var, double W) +{ + return sqrt (var / W); +} + /* Returns the standard error of the skewness for the given total weight W. diff --git a/src/math/moments.h b/src/math/moments.h index 55c517e521..8bf916592e 100644 --- a/src/math/moments.h +++ b/src/math/moments.h @@ -65,7 +65,7 @@ void moments1_calculate (const struct moments1 *, void moments1_destroy (struct moments1 *); /* Standard errors. */ -double calc_semean (double stddev, double weight); +double calc_semean (double var, double weight); double calc_seskew (double weight); double calc_sekurt (double weight);