struct pair
{
/* The variables comprising the pair */
- struct variable *v[2];
+ const struct variable *v[2];
/* The number of valid variable pairs */
double n;
int i;
struct hsh_iterator hi;
- struct hsh_table *hash;
- struct variable *v;
+ struct const_hsh_table *hash;
+ const struct variable *v;
- hash = hsh_create (n_pairs, compare_vars_by_name, hash_var_by_name,
+ hash = const_hsh_create (n_pairs, compare_vars_by_name, hash_var_by_name,
0, 0);
for (i=0; i < n_pairs; ++i)
{
- hsh_insert(hash,pairs[i].v[0]);
- hsh_insert(hash,pairs[i].v[1]);
+ const_hsh_insert (hash, pairs[i].v[0]);
+ const_hsh_insert (hash, pairs[i].v[1]);
}
assert(cmd.n_variables == 0);
- cmd.n_variables = hsh_count(hash);
+ cmd.n_variables = const_hsh_count (hash);
cmd.v_variables = xnrealloc (cmd.v_variables, cmd.n_variables,
sizeof *cmd.v_variables);
/* Iterate through the hash */
- for (i=0,v = (struct variable *) hsh_first(hash,&hi);
+ for (i=0,v = const_hsh_first (hash, &hi);
v != 0;
- v=hsh_next(hash,&hi) )
+ v = const_hsh_next (hash, &hi) )
cmd.v_variables[i++]=v;
-
- hsh_destroy(hash);
+ const_hsh_destroy(hash);
}
}
else if ( !cmd.sbc_variables)
static int
tts_custom_pairs (struct lexer *lexer, struct dataset *ds, struct cmd_t_test *cmd UNUSED, void *aux UNUSED)
{
- struct variable **vars;
+ const struct variable **vars;
size_t n_vars;
size_t n_pairs_local;
lex_match (lexer, '=');
n_vars=0;
- if (!parse_variables (lexer, dataset_dict (ds), &vars, &n_vars,
+ if (!parse_variables_const (lexer, dataset_dict (ds), &vars, &n_vars,
PV_DUPLICATE | PV_NUMERIC | PV_NO_SCRATCH))
{
free (vars);
if (lex_match (lexer, T_WITH))
{
n_before_WITH = n_vars;
- if (!parse_variables (lexer, dataset_dict (ds), &vars, &n_vars,
+ if (!parse_variables_const (lexer, dataset_dict (ds), &vars, &n_vars,
PV_DUPLICATE | PV_APPEND
| PV_NUMERIC | PV_NO_SCRATCH))
{
msg (SE, _("PAIRED was specified but the number of variables "
"preceding WITH (%d) did not match the number "
"following (%d)."),
- n_before_WITH, n_after_WITH );
+ (int) n_before_WITH, (int) n_after_WITH );
return 0;
}
n_pairs_local = n_before_WITH;
for (i=0; i < cmd->n_variables; ++i)
{
- struct variable *var = cmd->v_variables[i];
+ const struct variable *var = cmd->v_variables[i];
struct hsh_table *grp_hash = group_proc_get (var)->group_hash;
int count=0;
gs = hsh_find(grp_hash, (void *) &search_val);
assert(gs);
- tab_float(ssb->t, 2 ,i*2+count+1, TAB_RIGHT, gs->n, 2, 0);
+ tab_float(ssb->t, 2 ,i*2+count+1, TAB_RIGHT, gs->n, 10, 0);
tab_float(ssb->t, 3 ,i*2+count+1, TAB_RIGHT, gs->mean, 8, 2);
tab_float(ssb->t, 4 ,i*2+count+1, TAB_RIGHT, gs->std_dev, 8, 3);
tab_float(ssb->t, 5 ,i*2+count+1, TAB_RIGHT, gs->se_mean, 8, 3);
/* Values */
tab_float (ssb->t,2, i*2+j+1, TAB_RIGHT, pairs[i].mean[j], 8, 2);
- tab_float (ssb->t,3, i*2+j+1, TAB_RIGHT, pairs[i].n, 2, 0);
+ tab_float (ssb->t,3, i*2+j+1, TAB_RIGHT, pairs[i].n, 10, 0);
tab_float (ssb->t,4, i*2+j+1, TAB_RIGHT, pairs[i].std_dev[j], 8, 3);
tab_float (ssb->t,5, i*2+j+1, TAB_RIGHT, pairs[i].std_dev[j]/sqrt(pairs[i].n), 8, 3);
struct group_statistics *gs = &group_proc_get (cmd->v_variables[i])->ugs;
tab_text (ssb->t, 0, i+1, TAB_LEFT, var_get_name (cmd->v_variables[i]));
- tab_float (ssb->t,1, i+1, TAB_RIGHT, gs->n, 2, 0);
+ tab_float (ssb->t,1, i+1, TAB_RIGHT, gs->n, 10, 0);
tab_float (ssb->t,2, i+1, TAB_RIGHT, gs->mean, 8, 2);
tab_float (ssb->t,3, i+1, TAB_RIGHT, gs->std_dev, 8, 2);
tab_float (ssb->t,4, i+1, TAB_RIGHT, gs->se_mean, 8, 3);
double std_err_diff;
double mean_diff;
- struct variable *var = cmd->v_variables[i];
+ const struct variable *var = cmd->v_variables[i];
struct group_proc *grp_data = group_proc_get (var);
struct hsh_table *grp_hash = grp_data->group_hash;
tab_float(self->t, 3, i*2+3, TAB_CENTER, q, 8,3 );
df = gs0->n + gs1->n - 2.0 ;
- tab_float (self->t, 5, i*2+3, TAB_RIGHT, df, 2, 0);
+ tab_float (self->t, 5, i*2+3, TAB_RIGHT, df, 10, 0);
pooled_variance = ( (gs0->n )*pow2(gs0->s_std_dev)
+
tab_float(trb->t, 7, i+3, TAB_RIGHT, t , 8,3 );
/* Degrees of freedom */
- tab_float(trb->t, 8, i+3, TAB_RIGHT, df , 2, 0 );
+ tab_float(trb->t, 8, i+3, TAB_RIGHT, df , 10, 0 );
p = gsl_cdf_tdist_P(t,df);
q = gsl_cdf_tdist_P(t,df);
for(i = 0; i < cmd->n_variables ; ++i)
{
- struct variable *v = cmd->v_variables[i];
+ const struct variable *v = cmd->v_variables[i];
if (! casefilter_variable_missing (filter, c, v) )
{
for(i=0; i< cmd->n_variables ; ++i)
{
struct group_statistics *gs;
- struct variable *v = cmd->v_variables[i];
+ const struct variable *v = cmd->v_variables[i];
const union value *val = case_data (c, v);
gs= &group_proc_get (cmd->v_variables[i])->ugs;
for(i=0; i < n_pairs ; ++i )
{
- struct variable *v0 = pairs[i].v[0];
- struct variable *v1 = pairs[i].v[1];
+ const struct variable *v0 = pairs[i].v[0];
+ const struct variable *v1 = pairs[i].v[1];
const union value *val0 = case_data (c, v0);
const union value *val1 = case_data (c, v1);
for(i=0; i< cmd->n_variables ; ++i)
{
- struct variable *var = cmd->v_variables[i];
+ const struct variable *var = cmd->v_variables[i];
const union value *val = case_data (c, var);
struct hsh_table *grp_hash = group_proc_get (var)->group_hash;
struct group_statistics *gs;
for (i = 0; i < cmd->n_variables ; ++i)
{
- struct variable *var = cmd->v_variables[i];
+ const struct variable *var = cmd->v_variables[i];
struct hsh_table *grp_hash = group_proc_get (var)->group_hash;
struct hsh_iterator g;
struct group_statistics *gs;
struct cmd_t_test *cmd = (struct cmd_t_test *) cmd_;
- struct casefilter *filter = casefilter_create (cmd->miss != TTS_INCLUDE,
+ struct casefilter *filter = casefilter_create ((cmd->miss != TTS_INCLUDE
+ ? MV_ANY : MV_SYSTEM),
NULL, 0);
if ( cmd->miss == TTS_LISTWISE )