From: Ben Pfaff Date: Sun, 5 Oct 2008 21:56:01 +0000 (-0700) Subject: Eliminate unused code in glm.q, regression.q. X-Git-Tag: v0.7.1~50^2~33 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa1cc7513bbb306fb00503007575db8ffb76602e;p=pspp-builds.git Eliminate unused code in glm.q, regression.q. --- diff --git a/src/language/stats/glm.q b/src/language/stats/glm.q index 48c3b221..39e4f1c5 100644 --- a/src/language/stats/glm.q +++ b/src/language/stats/glm.q @@ -159,39 +159,6 @@ coeff_init (pspp_linreg_cache * c, struct design_matrix *cov) pspp_coeff_init (c->coeff, cov); } -/* - Put the moments in the linreg cache. - */ -static void -compute_moments (pspp_linreg_cache * c, struct moments_var *mom, - struct design_matrix *dm, size_t n) -{ - size_t i; - size_t j; - double weight; - double mean; - double variance; - double skewness; - double kurtosis; - /* - Scan the variable names in the columns of the design matrix. - When we find the variable we need, insert its mean in the cache. - */ - for (i = 0; i < dm->m->size2; i++) - { - for (j = 0; j < n; j++) - { - if (design_matrix_col_to_var (dm, i) == (mom + j)->v) - { - moments1_calculate ((mom + j)->m, &weight, &mean, &variance, - &skewness, &kurtosis); - gsl_vector_set (c->indep_means, i, mean); - gsl_vector_set (c->indep_std, i, sqrt (variance)); - } - } - } -} - /* Encode categorical variables. Returns number of valid cases. */ static int diff --git a/src/language/stats/regression.q b/src/language/stats/regression.q index 08954d87..4f6f0b86 100644 --- a/src/language/stats/regression.q +++ b/src/language/stats/regression.q @@ -861,39 +861,6 @@ coeff_init (pspp_linreg_cache * c, struct design_matrix *dm) pspp_coeff_init (c->coeff, dm); } -/* - Put the moments in the linreg cache. - */ -static void -compute_moments (pspp_linreg_cache * c, struct moments_var *mom, - struct design_matrix *dm, size_t n) -{ - size_t i; - size_t j; - double weight; - double mean; - double variance; - double skewness; - double kurtosis; - /* - Scan the variable names in the columns of the design matrix. - When we find the variable we need, insert its mean in the cache. - */ - for (i = 0; i < dm->m->size2; i++) - { - for (j = 0; j < n; j++) - { - if (design_matrix_col_to_var (dm, i) == (mom + j)->v) - { - moments1_calculate ((mom + j)->m, &weight, &mean, &variance, - &skewness, &kurtosis); - pspp_linreg_set_indep_variable_mean (c, (mom + j)->v, mean); - pspp_linreg_set_indep_variable_sd (c, (mom + j)->v, sqrt (variance)); - } - } - } -} - static bool run_regression (struct casereader *input, struct cmd_regression *cmd, struct dataset *ds, pspp_linreg_cache **models)