X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Fstats%2Ft-test-indep.c;h=a2e0d4d35557777924a5ddf132af32c9e8564a14;hb=ad4f9604cc877272fe504234e8b9078a7ce76e17;hp=f17a1d5b785fdb739092dd11f79ea57e6855c913;hpb=1e0e76eaeb51ef0c15fdcfc4bd12d9310c16a88b;p=pspp diff --git a/src/language/stats/t-test-indep.c b/src/language/stats/t-test-indep.c index f17a1d5b78..a2e0d4d355 100644 --- a/src/language/stats/t-test-indep.c +++ b/src/language/stats/t-test-indep.c @@ -104,7 +104,7 @@ indep_run (struct tt *tt, const struct variable *gvar, double w = dict_get_case_weight (tt->dict, c, NULL); const union value *gv = case_data (c, gvar); - + int grp = which_group (gv, &is); if ( grp < 0) continue; @@ -169,7 +169,7 @@ indep_run (struct tt *tt, const struct variable *gvar, for (v = 0; v < tt->n_vars; ++v) ps[v].lev = levene_calculate (ps[v].nl); - + indep_summary (tt, &is, ps); indep_test (tt, ps); @@ -247,7 +247,7 @@ indep_summary (const struct tt *tt, struct indep_samples *is, const struct pair_ { double cc, mean, sigma; moments_calculate (ps[v].mom[i], &cc, &mean, &sigma, NULL, NULL); - + tab_double (t, 2, v * 2 + i + heading_rows, TAB_RIGHT, cc, NULL, RC_WEIGHT); tab_double (t, 3, v * 2 + i + heading_rows, TAB_RIGHT, mean, NULL, RC_OTHER); tab_double (t, 4, v * 2 + i + heading_rows, TAB_RIGHT, sqrt (sigma), NULL, RC_OTHER); @@ -318,7 +318,7 @@ indep_test (const struct tt *tt, const struct pair_stats *ps) df = cc0 + cc1 - 2.0; tab_double (t, 5, v * 2 + heading_rows, TAB_RIGHT, df, NULL, RC_OTHER); - + pooled_variance = ((cc0 - 1)* sigma0 + (cc1 - 1) * sigma1) / df ; tval = (mean0 - mean1) / sqrt (pooled_variance); @@ -386,7 +386,7 @@ indep_test (const struct tt *tt, const struct pair_stats *ps) double df1 = 1; double df2 = cc0 + cc1 - 2; double q = gsl_cdf_fdist_Q (ps[v].lev, df1, df2); - tab_double (t, 3, v * 2 + heading_rows, TAB_CENTER, q, NULL, RC_OTHER); + tab_double (t, 3, v * 2 + heading_rows, TAB_CENTER, q, NULL, RC_PVALUE); } }