void
ks_one_sample_execute (const struct dataset *ds,
- struct casereader *input,
- enum mv_class exclude,
- const struct npar_test *test)
+ struct casereader *input,
+ enum mv_class exclude,
+ const struct npar_test *test,
+ bool x UNUSED, double y UNUSED)
{
const struct dictionary *dict = dataset_dict (ds);
const struct ks_one_sample_test *kst = UP_CAST (test, const struct ks_one_sample_test, parent.parent);
const struct fmt_spec *wfmt = wvar ? var_get_print_format (wvar) : & F_8_0;
bool warn = true;
int v;
+ struct casereader *r = casereader_clone (input);
- struct ks *ks = xcalloc (sizeof *ks, ost->n_vars);
+ struct ks *ks = xcalloc (ost->n_vars, sizeof *ks);
for (v = 0; v < ost->n_vars; ++v)
{
ks[v].ssq = 0;
}
- struct casereader *r = casereader_clone (input);
-
for (; (c = casereader_read (r)) != NULL; case_unref (c))
{
const double weight = dict_get_case_weight (dict, c, &warn);
for (v = 0; v < ost->n_vars; ++v)
{
+ const struct variable *var = ost->vars[v];
+ double cc = 0;
+ double prev_empirical = 0;
+
switch (kst->dist)
{
case KS_UNIFORM:
NOT_REACHED ();
}
- const struct variable *var = ost->vars[v];
- double cc = 0;
- double prev_empirical = 0;
r = sort_execute_1var (casereader_clone (input), var);
for (; (c = casereader_read (r)) != NULL; case_unref (c))
{
const int nc = kst->parent.n_vars + column_headers;
const int nr = 8 + row_headers;
struct tab_table *table = tab_create (nc, nr);
-
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_headers (table, row_headers, 0, column_headers, 0);
tab_title (table, _("One-Sample Kolmogorov-Smirnov Test"));
switch (kst->dist)
{
case KS_UNIFORM:
- tab_double (table, col, 1, 0, ks[i].obs_cc, wfmt);
- tab_double (table, col, 2, 0, ks[i].test_min, NULL);
- tab_double (table, col, 3, 0, ks[i].test_max, NULL);
+ tab_double (table, col, 1, 0, ks[i].obs_cc, NULL, RC_WEIGHT);
+ tab_double (table, col, 2, 0, ks[i].test_min, NULL, RC_OTHER);
+ tab_double (table, col, 3, 0, ks[i].test_max, NULL, RC_OTHER);
break;
case KS_NORMAL:
- tab_double (table, col, 1, 0, ks[i].obs_cc, wfmt);
- tab_double (table, col, 2, 0, ks[i].mu, NULL);
- tab_double (table, col, 3, 0, ks[i].sigma, NULL);
+ tab_double (table, col, 1, 0, ks[i].obs_cc, NULL, RC_WEIGHT);
+ tab_double (table, col, 2, 0, ks[i].mu, NULL, RC_OTHER);
+ tab_double (table, col, 3, 0, ks[i].sigma, NULL, RC_OTHER);
break;
case KS_POISSON:
case KS_EXPONENTIAL:
- tab_double (table, col, 1, 0, ks[i].obs_cc, wfmt);
- tab_double (table, col, 2, 0, ks[i].mu, NULL);
+ tab_double (table, col, 1, 0, ks[i].obs_cc, NULL, RC_WEIGHT);
+ tab_double (table, col, 2, 0, ks[i].mu, NULL, RC_OTHER);
break;
default:
z = sqrt (ks[i].obs_cc) * abs;
- tab_double (table, col, 5, 0, ks[i].diff_pos, NULL);
- tab_double (table, col, 6, 0, ks[i].diff_neg, NULL);
+ tab_double (table, col, 5, 0, ks[i].diff_pos, NULL, RC_OTHER);
+ tab_double (table, col, 6, 0, ks[i].diff_neg, NULL, RC_OTHER);
- tab_double (table, col, 4, 0, abs, NULL);
+ tab_double (table, col, 4, 0, abs, NULL, RC_OTHER);
- tab_double (table, col, 7, 0, z, NULL);
- tab_double (table, col, 8, 0, ks_asymp_sig (z), NULL);
+ tab_double (table, col, 7, 0, z, NULL, RC_OTHER);
+ tab_double (table, col, 8, 0, ks_asymp_sig (z), NULL, RC_PVALUE);
}