/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011, 2012, 2013, 2014,
+ 2020 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
}
else if (lex_match_id (lexer, "CONTRAST"))
{
- struct contrasts_node *cl = xzalloc (sizeof *cl);
+ struct contrasts_node *cl = XZALLOC (struct contrasts_node);
struct ll_list *coefficient_list = &cl->coefficient_list;
lex_match (lexer, T_EQUALS);
struct oneway_workspace ws;
ws.actual_number_of_groups = 0;
- ws.vws = xzalloc (cmd->n_vars * sizeof (*ws.vws));
- ws.dd_total = xmalloc (sizeof (struct descriptive_data) * cmd->n_vars);
+ ws.vws = xcalloc (cmd->n_vars, sizeof (*ws.vws));
+ ws.dd_total = XCALLOC (cmd->n_vars, struct descriptive_data*);
for (v = 0 ; v < cmd->n_vars; ++v)
ws.dd_total[v] = dd_create (cmd->vars[v]);
if (MISS_ANALYSIS == cmd->missing_type)
{
- if (var_is_value_missing (v, val, cmd->exclude))
+ if (var_is_value_missing (v, val) & cmd->exclude)
continue;
}
if (MISS_ANALYSIS == cmd->missing_type)
{
- if (var_is_value_missing (v, val, cmd->exclude))
+ if (var_is_value_missing (v, val) & cmd->exclude)
continue;
}
if (MISS_ANALYSIS == cmd->missing_type)
{
- if (var_is_value_missing (v, val, cmd->exclude))
+ if (var_is_value_missing (v, val) & cmd->exclude)
continue;
}
df_numerator = pow2 (df_numerator);
double std_error_contrast = sqrt (pvw->mse * coef_msq);
- double T = fabs (contrast_value / std_error_contrast);
+ double T = contrast_value / std_error_contrast;
double T_ne = contrast_value / sec_vneq;
double df_ne = df_numerator / df_denominator;
- double p_ne = gsl_cdf_tdist_P (T_ne, df_ne);
- double q_ne = gsl_cdf_tdist_Q (T_ne, df_ne);
struct entry
{
{ 1, 0, std_error_contrast },
{ 2, 0, T },
{ 3, 0, df },
- { 4, 0, 2 * gsl_cdf_tdist_Q (T, df) },
+ { 4, 0, 2 * gsl_cdf_tdist_Q (fabs(T), df) },
/* Do not assume equal. */
{ 0, 1, contrast_value },
{ 1, 1, sec_vneq },
{ 2, 1, T_ne },
{ 3, 1, df_ne },
- { 4, 1, 2 * (T > 0 ? q_ne : p_ne) },
+ { 4, 1, 2 * gsl_cdf_tdist_Q (fabs(T_ne), df_ne) },
};
for (size_t i = 0; i < sizeof entries / sizeof *entries; i++)
_("Multiple Comparisons (%s)"),
var_to_string (cmd->vars[v]))),
"Multiple Comparisons");
- table->look.omit_empty = true;
struct pivot_dimension *statistics = pivot_dimension_create (
table, PIVOT_AXIS_COLUMN, N_("Statistics"),