CORRELATIONS: Properly deal with case weights.
[pspp-builds.git] / src / math / covariance.c
index b2d43427aae60fa7ff90fb17768266adedc223d7..ba0de0b6968bcb560a4c738495c72f069899ba07 100644 (file)
@@ -153,7 +153,7 @@ covariance_accumulate (struct covariance *cov, const struct ccase *c)
          idx = cm_idx (cov, i, j);
          if (idx >= 0)
            {
-             cov->cm [idx] += val1->f * val2->f;
+             cov->cm [idx] += val1->f * val2->f * weight;
            }
 
          for (m = 0 ; m < n_MOMENTS; ++m)