-
- key.id = *gv;
-
- for (i = 0; i < l->n_dep; ++i)
- {
- struct variable *var = l->v_dep[i];
- struct group_proc *gp = group_proc_get (var);
- double levene_z;
- const union value *v = case_data (c, var->fv);
- struct group_statistics *gs;
-
- gs = hsh_find(gp->group_hash,(void *) &key );
-
- if ( 0 == gs )
- continue ;
-
- if ( ! l->is_missing(&var->miss, v))
- {
- levene_z= fabs(v->f - gs->mean);
- lz[i].grand_total += levene_z * weight;
- lz[i].total_n += weight;
-
- gs->lz_total += levene_z * weight;
- }
-
- }
- return 0;
-}
-
-
-static void
-levene_postcalc (void *_l)
-{
- size_t v;
-
- struct levene_info *l = (struct levene_info *) _l;
-
- for (v = 0; v < l->n_dep; ++v)
- {
- /* This is Z_LL */
- lz[v].grand_mean = lz[v].grand_total / lz[v].total_n ;
- }
-
-
-}
-
-
-/* The denominator for the expression for the Levene */
-static double *lz_denominator;
-
-static void
-levene2_precalc (void *_l)
-{
- size_t v;
-
- struct levene_info *l = (struct levene_info *) _l;
-
- lz_denominator = xnmalloc (l->n_dep, sizeof *lz_denominator);
-
- /* This stuff could go in the first post calc . . . */
- for (v = 0; v < l->n_dep; ++v)
- {
- struct hsh_iterator hi;
- struct group_statistics *g;
-
- struct variable *var = l->v_dep[v] ;
- struct hsh_table *hash = group_proc_get (var)->group_hash;
-
-
- for(g = (struct group_statistics *) hsh_first(hash,&hi);
- g != 0 ;
- g = (struct group_statistics *) hsh_next(hash,&hi) )
- {
- g->lz_mean = g->lz_total / g->n ;
- }
- lz_denominator[v] = 0;