#include <math.h>
#include "alloc.h"
#include "str.h"
+#include "case.h"
#include "command.h"
#include "lexer.h"
#include "error.h"
n_pairs+=n_pairs_local;
+ free (vars);
return 1;
}
ssbox_base_init(this, hsize,vsize);
tab_title (this->t, 0, _("One-Sample Statistics"));
- tab_vline(this->t, TAL_2, 1,0,vsize);
+ tab_vline(this->t, TAL_2, 1,0,vsize - 1);
tab_text (this->t, 1, 0, TAB_CENTER | TAT_TITLE, _("N"));
tab_text (this->t, 2, 0, TAB_CENTER | TAT_TITLE, _("Mean"));
tab_text (this->t, 3, 0, TAB_CENTER | TAT_TITLE, _("Std. Deviation"));
ssbox_base_init(this, hsize,vsize);
tab_title (this->t, 0, _("Group Statistics"));
- tab_vline(this->t,0,1,0,vsize);
+ tab_vline(this->t,0,1,0,vsize - 1);
tab_text (this->t, 1, 0, TAB_CENTER | TAT_TITLE, indep_var->name);
tab_text (this->t, 2, 0, TAB_CENTER | TAT_TITLE, _("N"));
tab_text (this->t, 3, 0, TAB_CENTER | TAT_TITLE, _("Mean"));
trbox_base_init(self,n_pairs,hsize);
tab_title (self->t, 0, _("Paired Samples Test"));
tab_hline(self->t,TAL_1,2,6,1);
- tab_vline(self->t,TAL_2,2,0,vsize);
+ tab_vline(self->t,TAL_2,2,0,vsize - 1);
tab_joint_text(self->t,2,0,6,0,TAB_CENTER,_("Paired Differences"));
tab_box(self->t,-1,-1,-1,TAL_1, 2,1,6,vsize-1);
tab_box(self->t,-1,-1,-1,TAL_1, 6,0,hsize-1,vsize-1);
trbox_base_init(self, cmd->n_variables,hsize);
tab_title (self->t, 0, _("One-Sample Test"));
tab_hline(self->t, TAL_1, 1, hsize - 1, 1);
- tab_vline(self->t, TAL_2, 1, 0, vsize);
+ tab_vline(self->t, TAL_2, 1, 0, vsize - 1);
tab_joint_text(self->t, 1, 0, hsize-1,0, TAB_CENTER | TAT_PRINTF,
_("Test Value = %f"),cmd->n_testval);
for(i=0; i< cmd->n_variables ; ++i)
{
struct variable *v = cmd->v_variables[i];
- const union value *val = &c->data[v->fv];
+ const union value *val = case_data (c, v->fv);
if (value_is_missing(val,v) )
{
/* Listwise has to be implicit if the independent variable is missing ?? */
if ( cmd->sbc_groups )
{
- const union value *gv = &c->data[indep_var->fv];
+ const union value *gv = case_data (c, indep_var->fv);
if ( value_is_missing(gv,indep_var) )
{
return 0;
{
struct group_statistics *gs;
struct variable *v = cmd->v_variables[i];
- const union value *val = &c->data[v->fv];
+ const union value *val = case_data (c, v->fv);
gs= &cmd->v_variables[i]->p.t_t.ugs;
for(i=0; i< cmd->n_variables ; ++i)
{
struct variable *v = cmd->v_variables[i];
- const union value *val = &c->data[v->fv];
+ const union value *val = case_data (c, v->fv);
if (value_is_missing(val,v) )
{
{
struct group_statistics *gs;
struct variable *v = cmd->v_variables[i];
- const union value *val = &c->data[v->fv];
+ const union value *val = case_data (c, v->fv);
gs= &cmd->v_variables[i]->p.t_t.ugs;
struct variable *v0 = pairs[i].v[0];
struct variable *v1 = pairs[i].v[1];
- const union value *val0 = &c->data[v0->fv];
- const union value *val1 = &c->data[v1->fv];
+ const union value *val0 = case_data (c, v0->fv);
+ const union value *val1 = case_data (c, v1->fv);
if ( value_is_missing(val0,v0) ||
value_is_missing(val1,v1) )
struct variable *v0 = pairs[i].v[0];
struct variable *v1 = pairs[i].v[1];
- const union value *val0 = &c->data[v0->fv];
- const union value *val1 = &c->data[v1->fv];
+ const union value *val0 = case_data (c, v0->fv);
+ const union value *val1 = case_data (c, v1->fv);
if ( ( !value_is_missing(val0,v0) && !value_is_missing(val1,v1) ) )
{
int i;
int g;
- const union value *gv = &c->data[indep_var->fv];
+ const union value *gv = case_data (c, indep_var->fv);
const double weight = dict_get_case_weight(default_dict,c,&bad_weight_warn);
for(i=0; i< cmd->n_variables ; ++i)
{
struct variable *v = cmd->v_variables[i];
- const union value *val = &c->data[v->fv];
+ const union value *val = case_data (c, v->fv);
if (value_is_missing(val,v) )
{
}
- gv = &c->data[indep_var->fv];
+ gv = case_data (c, indep_var->fv);
g = get_group(gv,indep_var);
struct group_statistics *gs = &var->p.t_t.gs[g];
- const union value *val=&c->data[var->fv];
+ const union value *val = case_data (c, var->fv);
if ( !value_is_missing(val,var) )
{
struct trbox test_results_box;
struct casereader *r;
- const struct ccase *c;
+ struct ccase c;
struct cmd_t_test *cmd = (struct cmd_t_test *) cmd_;
common_precalc(cmd);
for(r = casefile_get_reader (cf);
- casereader_read (r, &c) ; )
+ casereader_read (r, &c) ;
+ case_destroy (&c))
{
- common_calc(c,cmd);
+ common_calc(&c,cmd);
}
casereader_destroy (r);
common_postcalc(cmd);
case T_1_SAMPLE:
one_sample_precalc(cmd);
for(r = casefile_get_reader (cf);
- casereader_read (r, &c) ; )
+ casereader_read (r, &c) ;
+ case_destroy (&c))
{
- one_sample_calc(c,cmd);
+ one_sample_calc(&c,cmd);
}
casereader_destroy (r);
one_sample_postcalc(cmd);
case T_PAIRED:
paired_precalc(cmd);
for(r = casefile_get_reader (cf);
- casereader_read (r, &c) ; )
+ casereader_read (r, &c) ;
+ case_destroy (&c))
{
- paired_calc(c,cmd);
+ paired_calc(&c,cmd);
}
casereader_destroy (r);
paired_postcalc(cmd);
group_precalc(cmd);
for(r = casefile_get_reader (cf);
- casereader_read (r, &c) ; )
+ casereader_read (r, &c) ;
+ case_destroy (&c))
{
- group_calc(c,cmd);
+ group_calc(&c,cmd);
}
casereader_destroy (r);
group_postcalc(cmd);