/* PSPP - a program for statistical analysis.
- Copyright (C) 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011, 2013, 2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
reliability.model = MODEL_SPLIT;
reliability.split_point = -1;
- if ( lex_match (lexer, T_LPAREN))
+ if ( lex_match (lexer, T_LPAREN)
+ && lex_force_num (lexer))
{
- lex_force_num (lexer);
reliability.split_point = lex_number (lexer);
lex_get (lexer);
lex_force_match (lexer, T_RPAREN);
}
}
}
+ else if (lex_match_id (lexer, "STATISTICS"))
+ {
+ lex_match (lexer, T_EQUALS);
+ msg (SW, _("The STATISTICS subcommand is not yet implemented. "
+ "No statistics will be produced."));
+ while (lex_match (lexer, T_ID))
+ continue;
+ }
else
{
lex_error (lexer, NULL);
int heading_rows = 1;
struct tab_table *tbl;
tbl = tab_create (n_cols, n_rows);
+ tab_set_format (tbl, RC_WEIGHT, wfmt);
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
tab_title (tbl, _("Case Processing Summary"));
total = n_missing + n_valid;
tab_double (tbl, 2, heading_rows, TAB_RIGHT,
- n_valid, wfmt);
+ n_valid, NULL, RC_WEIGHT);
tab_double (tbl, 2, heading_rows + 1, TAB_RIGHT,
- n_missing, wfmt);
+ n_missing, NULL, RC_WEIGHT);
tab_double (tbl, 2, heading_rows + 2, TAB_RIGHT,
- total, wfmt);
+ total, NULL, RC_WEIGHT);
tab_double (tbl, 3, heading_rows, TAB_RIGHT,
- 100 * n_valid / (double) total, NULL);
+ 100 * n_valid / (double) total, NULL, RC_OTHER);
tab_double (tbl, 3, heading_rows + 1, TAB_RIGHT,
- 100 * n_missing / (double) total, NULL);
+ 100 * n_missing / (double) total, NULL, RC_OTHER);
tab_double (tbl, 3, heading_rows + 2, TAB_RIGHT,
- 100 * total / (double) total, NULL);
+ 100 * total / (double) total, NULL, RC_OTHER);
tab_submit (tbl);
const int heading_columns = 1;
const int heading_rows = 1;
const int n_rows = rel->sc[0].n_items + heading_rows ;
-
+ const struct variable *wv = rel->wv;
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
struct tab_table *tbl = tab_create (n_cols, n_rows);
+ tab_set_format (tbl, RC_WEIGHT, wfmt);
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
tab_title (tbl, _("Item-Total Statistics"));
moments1_calculate (s->total, &weight, &mean, &var, 0, 0);
tab_double (tbl, 1, heading_rows + i, TAB_RIGHT,
- mean, NULL);
+ mean, NULL, RC_OTHER);
tab_double (tbl, 2, heading_rows + i, TAB_RIGHT,
- s->variance_of_sums, NULL);
+ s->variance_of_sums, NULL, RC_OTHER);
tab_double (tbl, 4, heading_rows + i, TAB_RIGHT,
- s->alpha, NULL);
+ s->alpha, NULL, RC_OTHER);
moments1_calculate (rel->sc[0].m[i], &weight, &mean, &var, 0,0);
tab_double (tbl, 3, heading_rows + i, TAB_RIGHT,
- item_to_total_r, NULL);
+ item_to_total_r, NULL, RC_OTHER);
}
int n_rows = rol[rel->model].n_rows;
int heading_columns = rol[rel->model].heading_cols;
int heading_rows = rol[rel->model].heading_rows;
-
+ const struct variable *wv = rel->wv;
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
struct tab_table *tbl = tab_create (n_cols, n_rows);
+ tab_set_format (tbl, RC_WEIGHT, wfmt);
+
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
tab_title (tbl, _("Reliability Statistics"));
reliability_statistics_model_alpha (struct tab_table *tbl,
const struct reliability *rel)
{
- const struct variable *wv = rel->wv;
- const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
-
const struct cronbach *s = &rel->sc[0];
tab_text (tbl, 0, 0, TAB_CENTER | TAT_TITLE,
tab_text (tbl, 1, 0, TAB_CENTER | TAT_TITLE,
_("N of Items"));
- tab_double (tbl, 0, 1, TAB_RIGHT, s->alpha, NULL);
+ tab_double (tbl, 0, 1, TAB_RIGHT, s->alpha, NULL, RC_OTHER);
- tab_double (tbl, 1, 1, TAB_RIGHT, s->n_items, wfmt);
+ tab_double (tbl, 1, 1, TAB_RIGHT, s->n_items, NULL, RC_WEIGHT);
}
reliability_statistics_model_split (struct tab_table *tbl,
const struct reliability *rel)
{
- const struct variable *wv = rel->wv;
- const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
-
tab_text (tbl, 0, 0, TAB_LEFT,
_("Cronbach's Alpha"));
tab_text (tbl, 2, 1, TAB_LEFT,
_("N of Items"));
-
-
tab_text (tbl, 1, 2, TAB_LEFT,
_("Part 2"));
tab_text (tbl, 2, 3, TAB_LEFT,
_("N of Items"));
-
-
tab_text (tbl, 1, 4, TAB_LEFT,
_("Total N of Items"));
tab_text (tbl, 0, 5, TAB_LEFT,
_("Correlation Between Forms"));
-
tab_text (tbl, 0, 6, TAB_LEFT,
_("Spearman-Brown Coefficient"));
- tab_double (tbl, 3, 0, TAB_RIGHT, rel->sc[1].alpha, NULL);
- tab_double (tbl, 3, 2, TAB_RIGHT, rel->sc[2].alpha, NULL);
+ tab_double (tbl, 3, 0, TAB_RIGHT, rel->sc[1].alpha, NULL, RC_OTHER);
+ tab_double (tbl, 3, 2, TAB_RIGHT, rel->sc[2].alpha, NULL, RC_OTHER);
- tab_double (tbl, 3, 1, TAB_RIGHT, rel->sc[1].n_items, wfmt);
- tab_double (tbl, 3, 3, TAB_RIGHT, rel->sc[2].n_items, wfmt);
+ tab_double (tbl, 3, 1, TAB_RIGHT, rel->sc[1].n_items, NULL, RC_WEIGHT);
+ tab_double (tbl, 3, 3, TAB_RIGHT, rel->sc[2].n_items, NULL, RC_WEIGHT);
tab_double (tbl, 3, 4, TAB_RIGHT,
- rel->sc[1].n_items + rel->sc[2].n_items, wfmt);
+ rel->sc[1].n_items + rel->sc[2].n_items, NULL, RC_WEIGHT);
{
/* R is the correlation between the two parts */
r /= sqrt (rel->sc[2].variance_of_sums);
r /= 2.0;
- tab_double (tbl, 3, 5, TAB_RIGHT, r, NULL);
+ tab_double (tbl, 3, 5, TAB_RIGHT, r, NULL, RC_OTHER);
/* Equal length Spearman-Brown Coefficient */
- tab_double (tbl, 3, 6, TAB_RIGHT, 2 * r / (1.0 + r), NULL);
+ tab_double (tbl, 3, 6, TAB_RIGHT, 2 * r / (1.0 + r), NULL, RC_OTHER);
- tab_double (tbl, 3, 8, TAB_RIGHT, g, NULL);
+ tab_double (tbl, 3, 8, TAB_RIGHT, g, NULL, RC_OTHER);
tmp = (1.0 - r*r) * rel->sc[1].n_items * rel->sc[2].n_items /
pow2 (rel->sc[0].n_items);
uly -= pow2 (r);
uly /= 2 * tmp;
- tab_double (tbl, 3, 7, TAB_RIGHT, uly, NULL);
+ tab_double (tbl, 3, 7, TAB_RIGHT, uly, NULL, RC_OTHER);
}
}