From: John Darrington Date: Tue, 30 Nov 2004 08:59:50 +0000 (+0000) Subject: Fixed a bug which crept into the npplot function X-Git-Tag: v0.4.0~218 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8528fd919d1cebe194121ba267faa0f4ee48c94;p=pspp-builds.git Fixed a bug which crept into the npplot function --- diff --git a/po/en_GB.po b/po/en_GB.po index a75dc168..0767884d 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PSPP 0.3.1\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2004-11-23 13:37+0800\n" +"POT-Creation-Date: 2004-11-25 19:01+0800\n" "PO-Revision-Date: 2004-01-23 13:04+0800\n" "Last-Translator: John Darrington \n" "Language-Team: John Darrington \n" @@ -974,7 +974,7 @@ msgstr "" msgid "Variance" msgstr "" -#: src/descript.c:103 src/examine.q:1414 src/frequencies.q:116 +#: src/descript.c:103 src/examine.q:1429 src/frequencies.q:116 msgid "Kurtosis" msgstr "" @@ -4225,25 +4225,25 @@ msgstr "" msgid "Interquartile Range" msgstr "" -#: src/examine.q:1447 +#: src/examine.q:1478 #, c-format msgid "Normal Q-Q Plot of %s" msgstr "" -#: src/examine.q:1448 src/examine.q:1454 +#: src/examine.q:1479 src/examine.q:1485 msgid "Observed Value" msgstr "" -#: src/examine.q:1449 +#: src/examine.q:1480 msgid "Expected Normal" msgstr "" -#: src/examine.q:1452 +#: src/examine.q:1483 #, c-format msgid "Detrended Normal Q-Q Plot of %s" msgstr "" -#: src/examine.q:1455 +#: src/examine.q:1486 msgid "Dev from Normal" msgstr "" diff --git a/po/pspp.pot b/po/pspp.pot index e9f9a986..32d94075 100644 --- a/po/pspp.pot +++ b/po/pspp.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2004-11-23 13:37+0800\n" +"POT-Creation-Date: 2004-11-25 19:01+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -975,7 +975,7 @@ msgstr "" msgid "Variance" msgstr "" -#: src/descript.c:103 src/examine.q:1414 src/frequencies.q:116 +#: src/descript.c:103 src/examine.q:1429 src/frequencies.q:116 msgid "Kurtosis" msgstr "" @@ -4225,25 +4225,25 @@ msgstr "" msgid "Interquartile Range" msgstr "" -#: src/examine.q:1447 +#: src/examine.q:1478 #, c-format msgid "Normal Q-Q Plot of %s" msgstr "" -#: src/examine.q:1448 src/examine.q:1454 +#: src/examine.q:1479 src/examine.q:1485 msgid "Observed Value" msgstr "" -#: src/examine.q:1449 +#: src/examine.q:1480 msgid "Expected Normal" msgstr "" -#: src/examine.q:1452 +#: src/examine.q:1483 #, c-format msgid "Detrended Normal Q-Q Plot of %s" msgstr "" -#: src/examine.q:1455 +#: src/examine.q:1486 msgid "Dev from Normal" msgstr "" diff --git a/src/examine.q b/src/examine.q index 6859146f..4444f965 100644 --- a/src/examine.q +++ b/src/examine.q @@ -1463,9 +1463,6 @@ np_plot(const struct metrics *m, const char *factorname) /* Detrended Normal Plot */ struct chart dnp_chart; - const struct weighted_value *wv = *(m->wvp); - - /* The slope and intercept of the ideal normal probability line */ const double slope = 1.0 / m->stddev; const double intercept = - m->mean / m->stddev; @@ -1485,8 +1482,8 @@ np_plot(const struct metrics *m, const char *factorname) chart_write_xlabel(&dnp_chart, _("Observed Value")); chart_write_ylabel(&dnp_chart, _("Dev from Normal")); - yfirst = gsl_cdf_ugaussian_Pinv (wv[0].rank / ( m->n + 1)); - ylast = gsl_cdf_ugaussian_Pinv (wv[m->n_data-1].rank / ( m->n + 1)); + yfirst = gsl_cdf_ugaussian_Pinv (m->wvp[0]->rank / ( m->n + 1)); + ylast = gsl_cdf_ugaussian_Pinv (m->wvp[m->n_data-1]->rank / ( m->n + 1)); { /* Need to make sure that both the scatter plot and the ideal fit into the @@ -1516,11 +1513,11 @@ np_plot(const struct metrics *m, const char *factorname) double d_min = DBL_MAX; for ( i = 0 ; i < m->n_data; ++i ) { - const double ns = gsl_cdf_ugaussian_Pinv (wv[i].rank / ( m->n + 1)); + const double ns = gsl_cdf_ugaussian_Pinv (m->wvp[i]->rank / ( m->n + 1)); - chart_datum(&np_chart, 0, wv[i].v.f, ns); + chart_datum(&np_chart, 0, m->wvp[i]->v.f, ns); - d_data[i] = (wv[i].v.f - m->mean) / m->stddev - ns; + d_data[i] = (m->wvp[i]->v.f - m->mean) / m->stddev - ns; if ( d_data[i] < d_min ) d_min = d_data[i]; if ( d_data[i] > d_max ) d_max = d_data[i]; @@ -1530,7 +1527,7 @@ np_plot(const struct metrics *m, const char *factorname) chart_rounded_tick((d_max - d_min) / 5.0)); for ( i = 0 ; i < m->n_data; ++i ) - chart_datum(&dnp_chart, 0, wv[i].v.f, d_data[i]); + chart_datum(&dnp_chart, 0, m->wvp[i]->v.f, d_data[i]); free(d_data); }