You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include <config.h>
#include "levene.h"
struct variable *v_indep;
/* Number of dependent variables */
- int n_dep;
+ size_t n_dep;
/* The dependent variables */
struct variable **v_dep;
enum lev_missing missing;
/* Function to test for missing values */
- is_missing_func is_missing;
-
+ is_missing_func *is_missing;
};
/* First pass */
void
levene(const struct casefile *cf,
- struct variable *v_indep, int n_dep, struct variable **v_dep,
+ struct variable *v_indep, size_t n_dep, struct variable **v_dep,
enum lev_missing missing, is_missing_func value_is_missing)
{
struct casereader *r;
static void
levene_precalc (const struct levene_info *l)
{
- int i;
+ size_t i;
lz = xmalloc (sizeof (struct lz_stats ) * l->n_dep ) ;
static int
levene_calc (const struct ccase *c, void *_l)
{
- int i;
+ size_t i;
int warn = 0;
struct levene_info *l = (struct levene_info *) _l;
const union value *gv = case_data (c, l->v_indep->fv);
struct variable *v = l->v_dep[i];
const union value *val = case_data (c, v->fv);
- if (l->is_missing(val,v) )
+ if (l->is_missing (&v->miss, val) )
{
return 0;
}
if ( 0 == gs )
continue ;
- if ( ! l->is_missing(v,var))
+ if ( ! l->is_missing(&var->miss, v))
{
levene_z= fabs(v->f - gs->mean);
lz[i].grand_total += levene_z * weight;
static void
levene_postcalc (void *_l)
{
- int v;
+ size_t v;
struct levene_info *l = (struct levene_info *) _l;
static void
levene2_precalc (void *_l)
{
- int v;
+ size_t v;
struct levene_info *l = (struct levene_info *) _l;
static int
levene2_calc (const struct ccase *c, void *_l)
{
- int i;
+ size_t i;
int warn = 0;
struct levene_info *l = (struct levene_info *) _l;
struct variable *v = l->v_dep[i];
const union value *val = case_data (c, v->fv);
- if (l->is_missing(val,v) )
+ if (l->is_missing(&v->miss, val) )
{
return 0;
}
if ( 0 == gs )
continue;
- if ( ! l->is_missing(v,var) )
+ if ( ! l->is_missing (&var->miss, v) )
{
levene_z = fabs(v->f - gs->mean);
lz_denominator[i] += weight * pow2(levene_z - gs->lz_mean);
static void
levene2_postcalc (void *_l)
{
- int v;
+ size_t v;
struct levene_info *l = (struct levene_info *) _l;