X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fglm.q;h=0d792df898bd36efdbbd5e1b872f1245012401f4;hb=c360fff4fd3e4a98cfe02441f43c27725cead44b;hp=b4eddc7bcff1555a4ade9138b329eecac436cafe;hpb=f141f7f7e76cb0eb15d2207b60cc93ed18472cd4;p=pspp diff --git a/src/language/stats/glm.q b/src/language/stats/glm.q index b4eddc7bcf..0d792df898 100644 --- a/src/language/stats/glm.q +++ b/src/language/stats/glm.q @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -37,13 +36,12 @@ #include #include #include -#include #include #include -#include +#include #include #include -#include +#include #include "xalloc.h" #include "gettext.h" @@ -252,26 +250,13 @@ glm_custom_dependent (struct lexer *lexer, struct dataset *ds, return 1; } -/* - COV is the covariance matrix for variables included in the - model. That means the dependent variable is in there, too. - */ -static void -coeff_init (pspp_linreg_cache * c, const struct design_matrix *cov) -{ - c->coeff = xnmalloc (cov->m->size2, sizeof (*c->coeff)); - c->n_coeffs = cov->m->size2 - 1; - pspp_coeff_init (c->coeff, cov); -} - - -static pspp_linreg_cache * +static linreg * fit_model (const struct covariance *cov, const struct variable *dep_var, const struct variable ** indep_vars, size_t n_data, size_t n_indep) { - pspp_linreg_cache *result = NULL; + linreg *result = NULL; return result; } @@ -285,7 +270,7 @@ run_glm (struct casereader *input, const struct variable **numerics = NULL; const struct variable **categoricals = NULL; int n_indep = 0; - pspp_linreg_cache *model = NULL; + linreg *model = NULL; pspp_linreg_opts lopts; struct ccase *c; size_t i; @@ -374,7 +359,14 @@ run_glm (struct casereader *input, k++; } - cov = covariance_2pass_create (n_numerics, numerics, n_categoricals, categoricals, NULL, MV_NEVER); + struct categoricals *cats = + categoricals_create (categoricals, n_categoricals, + NULL, MV_NEVER, + NULL, NULL, NULL); + + cov = covariance_2pass_create (n_numerics, numerics, + cats, + NULL, MV_NEVER); reader = casereader_clone (input); reader = casereader_create_filter_missing (reader, numerics, n_numerics,