X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fctables.c;h=bb7f5c37aa973afe6a6b6431e37d81bef9ff9079;hb=c6caca37f19989f96ad843e2baee09a54c4f23ba;hp=b2274f3e44d2d3abc2f5644086385eba27ce4b93;hpb=75ade7b3b58ae95e6c9047198578dbbe2ca2cc45;p=pspp diff --git a/src/language/stats/ctables.c b/src/language/stats/ctables.c index b2274f3e44..bb7f5c37aa 100644 --- a/src/language/stats/ctables.c +++ b/src/language/stats/ctables.c @@ -2655,24 +2655,37 @@ ctables_summary_add (union ctables_summary *s, switch (ss->function) { case CTSF_TOTALN: - case CTSF_areaPCT_TOTALN: s->count += ss->weighted ? d_weight : 1.0; break; + case CTSF_areaPCT_TOTALN: + s->count += ss->weighted ? e_weight : 1.0; + break; + case CTSF_COUNT: - case CTSF_areaPCT_COUNT: if (is_scale || !excluded_missing) s->count += ss->weighted ? d_weight : 1.0; break; + case CTSF_areaPCT_COUNT: + if (is_scale || !excluded_missing) + s->count += ss->weighted ? e_weight : 1.0; + break; + case CTSF_VALIDN: - case CTSF_areaPCT_VALIDN: if (is_scale ? !is_scale_missing : !is_missing) s->count += ss->weighted ? d_weight : 1.0; break; + case CTSF_areaPCT_VALIDN: + if (is_scale + ? !is_scale_missing + : !is_missing) + s->count += ss->weighted ? e_weight : 1.0; + break; + case CTSF_areaID: break; @@ -2680,7 +2693,7 @@ ctables_summary_add (union ctables_summary *s, if (is_scale ? is_scale_missing : is_missing) - s->count += ss->weighted ? d_weight : 1.0; + s->count += ss->weighted ? e_weight : 1.0; break; case CTSF_ECOUNT: @@ -5264,7 +5277,7 @@ ctables_execute (struct dataset *ds, struct casereader *input, for (struct ccase *c = casereader_read (group); c; case_unref (c), c = casereader_read (group)) { - double d_weight = dict_get_case_weight (dict, c, &warn_on_invalid); + double d_weight = dict_get_rounded_case_weight (dict, c, &warn_on_invalid); double e_weight = (ct->e_weight ? var_force_valid_weight (ct->e_weight, case_num (c, ct->e_weight),