X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fexamine.q;h=c930cf01d3a54ecb3217d565230e0d827853bd30;hb=92f198d13c9214c0d75b936f0ea0dc2684ea914b;hp=14981e884e0469ae3c2ab080904684cc13ca7608;hpb=2322678e8fddbbf158b01b2720db2636404bba3b;p=pspp diff --git a/src/language/stats/examine.q b/src/language/stats/examine.q index 14981e884e..c930cf01d3 100644 --- a/src/language/stats/examine.q +++ b/src/language/stats/examine.q @@ -19,51 +19,54 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include + #include -#include "message.h" +#include +#include #include #include -#include -#include "alloc.h" -#include "str.h" -#include "case.h" -#include "dictionary.h" -#include "command.h" -#include "compiler.h" -#include "lexer.h" -#include "message.h" -#include "magic.h" -#include "misc.h" -#include "table.h" -#include "manager.h" -#include "value-labels.h" -#include "variable.h" -#include "procedure.h" -#include "hash.h" -#include "casefile.h" -#include "factor-stats.h" -#include "moments.h" -#include "percentiles.h" -#include "box-whisker.h" -#include "cartesian.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "gettext.h" #define _(msgid) gettext (msgid) #define N_(msgid) msgid /* (headers) */ -#include "chart.h" -#include "plot-hist.h" -#include "plot-chart.h" +#include +#include +#include /* (specification) "EXAMINE" (xmn_): *^variables=custom; +total=custom; +nototal=custom; - +missing=miss:pairwise/!listwise, - rep:report/!noreport, - incl:include/!exclude; + missing=miss:pairwise/!listwise, + rep:report/!noreport, + incl:include/!exclude; +compare=cmp:variables/!groups; +percentiles=custom; +id=var; @@ -148,7 +151,8 @@ void box_plot_variables(const struct factor *fctr, /* Per Split function */ -static bool run_examine(const struct casefile *cf, void *cmd_); +static bool run_examine(const struct ccase *, + const struct casefile *cf, void *cmd_); static void output_examine(void); @@ -194,7 +198,7 @@ cmd_examine(void) subc_list_double_create(&percentile_list); percentile_algorithm = PC_HAVERAGE; - if ( !parse_examine(&cmd) ) + if ( !parse_examine(&cmd, NULL) ) return CMD_FAILURE; /* If /MISSING=INCLUDE is set, then user missing values are ignored */ @@ -285,12 +289,13 @@ output_examine(void) { if ( cmd.cmp == XMN_GROUPS ) { - box_plot_group(0, dependent_vars, n_dependent_vars, - cmd.v_id); + box_plot_group (0, (const struct variable **) dependent_vars, + n_dependent_vars, cmd.v_id); } else - box_plot_variables(0, dependent_vars, n_dependent_vars, - cmd.v_id); + box_plot_variables (0, + (const struct variable **) dependent_vars, + n_dependent_vars, cmd.v_id); } if ( cmd.a_plot[XMN_PLT_HISTOGRAM] ) @@ -342,11 +347,13 @@ output_examine(void) if ( cmd.a_plot[XMN_PLT_BOXPLOT] ) { if ( cmd.cmp == XMN_VARIABLES ) - box_plot_variables(fctr, dependent_vars, n_dependent_vars, - cmd.v_id); + box_plot_variables (fctr, + (const struct variable **) dependent_vars, + n_dependent_vars, cmd.v_id); else - box_plot_group(fctr, dependent_vars, n_dependent_vars, - cmd.v_id); + box_plot_group (fctr, + (const struct variable **) dependent_vars, + n_dependent_vars, cmd.v_id); } for ( v = 0 ; v < n_dependent_vars; ++v ) @@ -416,7 +423,7 @@ list_to_ptile_hash(const subc_list_double *l) /* Parse the PERCENTILES subcommand */ static int -xmn_custom_percentiles(struct cmd_examine *p UNUSED) +xmn_custom_percentiles(struct cmd_examine *p UNUSED, void *aux UNUSED) { sbc_percentile = 1; @@ -471,7 +478,7 @@ xmn_custom_percentiles(struct cmd_examine *p UNUSED) /* TOTAL and NOTOTAL are simple, mutually exclusive flags */ static int -xmn_custom_total(struct cmd_examine *p) +xmn_custom_total(struct cmd_examine *p, void *aux UNUSED) { if ( p->sbc_nototal ) { @@ -483,7 +490,7 @@ xmn_custom_total(struct cmd_examine *p) } static int -xmn_custom_nototal(struct cmd_examine *p) +xmn_custom_nototal(struct cmd_examine *p, void *aux UNUSED) { if ( p->sbc_total ) { @@ -499,7 +506,7 @@ xmn_custom_nototal(struct cmd_examine *p) /* Parser for the variables sub command Returns 1 on success */ static int -xmn_custom_variables(struct cmd_examine *cmd ) +xmn_custom_variables(struct cmd_examine *cmd, void *aux UNUSED) { lex_match('='); @@ -671,7 +678,7 @@ factor_calc(struct ccase *c, int case_no, double weight, int case_missing) } static bool -run_examine(const struct casefile *cf, void *cmd_ ) +run_examine(const struct ccase *first, const struct casefile *cf, void *cmd_ ) { struct casereader *r; struct ccase c; @@ -679,9 +686,13 @@ run_examine(const struct casefile *cf, void *cmd_ ) const struct cmd_examine *cmd = (struct cmd_examine *) cmd_; + struct factor *fctr; + + output_split_file_values (first); + /* Make sure we haven't got rubbish left over from a previous split */ - struct factor *fctr = factors; + fctr = factors; while (fctr) { struct factor *next = fctr->next; @@ -914,7 +925,7 @@ show_summary(struct variable **dependent_var, int n_dep_var, tab_vline (tbl, TAL_2, heading_columns, 0, n_rows - 1); - tab_title (tbl, 0, _("Case Processing Summary")); + tab_title (tbl, _("Case Processing Summary")); tab_joint_text(tbl, heading_columns, 0, @@ -1120,7 +1131,7 @@ show_extremes(struct variable **dependent_var, int n_dep_var, tab_hline (tbl, TAL_2, 0, n_cols - 1, heading_rows ); - tab_title (tbl, 0, _("Extreme Values")); + tab_title (tbl, _("Extreme Values")); tab_vline (tbl, TAL_2, n_cols - 2, 0, n_rows -1); tab_vline (tbl, TAL_1, n_cols - 1, 0, n_rows -1); @@ -1369,7 +1380,7 @@ show_descriptives(struct variable **dependent_var, tab_text (tbl, n_cols - 2, 0, TAB_CENTER | TAT_TITLE, _("Statistic")); tab_text (tbl, n_cols - 1, 0, TAB_CENTER | TAT_TITLE, _("Std. Error")); - tab_title (tbl, 0, _("Descriptives")); + tab_title (tbl, _("Descriptives")); for ( i = 0 ; i < n_dep_var ; ++i ) @@ -1957,7 +1968,7 @@ show_percentiles(struct variable **dependent_var, tab_vline (tbl, TAL_2, n_heading_columns, 0, n_rows - 1); - tab_title (tbl, 0, _("Percentiles")); + tab_title (tbl, _("Percentiles")); tab_hline (tbl, TAL_1, n_heading_columns, n_cols - 1, 1 );