#include <libpspp/compiler.h>
#include <libpspp/message.h>
#include <math/design-matrix.h>
-#include <math/linreg/coefficient.h>
+#include <math/coefficient.h>
#include <math/linreg/linreg.h>
#include <output/table.h>
tab_float (t, 6, 1, 0, pval, 10, 2);
for (j = 1; j <= c->n_indeps; j++)
{
- v = pspp_linreg_coeff_get_var (c->coeff[j], 0);
+ v = pspp_coeff_get_var (c->coeff[j], 0);
label = var_to_string (v);
/* Do not overwrite the variable's name. */
strncpy (tmp, label, MAX_STRING);
for that value.
*/
- val = pspp_linreg_coeff_get_value (c->coeff[j], v);
+ val = pspp_coeff_get_value (c->coeff[j], v);
val_s = value_to_string (val, v);
strncat (tmp, val_s, MAX_STRING);
}
tab_text (t, 1, 1, TAB_CENTER | TAT_TITLE, _("Covariances"));
for (i = 1; i < c->n_coeffs; i++)
{
- const struct variable *v = pspp_linreg_coeff_get_var (c->coeff[i], 0);
+ const struct variable *v = pspp_coeff_get_var (c->coeff[i], 0);
label = var_to_string (v);
tab_text (t, 2, i, TAB_CENTER, label);
tab_text (t, i + 2, 0, TAB_CENTER, label);
size_t j;
int n_vars = 0;
struct variable **varlist;
- struct pspp_linreg_coeff *coeff;
+ struct pspp_coeff *coeff;
const struct variable *v;
union value *val;
for (i = 1; i < c->n_indeps; i++) /* c->coeff[0] is the intercept. */
{
coeff = c->coeff[i];
- v = pspp_linreg_coeff_get_var (coeff, 0);
+ v = pspp_coeff_get_var (coeff, 0);
if (v->type == ALPHA)
{
if (!reg_inserted (v, varlist, n_vars))
reg_print_depvars (FILE * fp, pspp_linreg_cache * c)
{
int i;
- struct pspp_linreg_coeff *coeff;
+ struct pspp_coeff *coeff;
const struct variable *v;
fprintf (fp, "char *model_depvars[%d] = {", c->n_indeps);
for (i = 1; i < c->n_indeps; i++)
{
coeff = c->coeff[i];
- v = pspp_linreg_coeff_get_var (coeff, 0);
+ v = pspp_coeff_get_var (coeff, 0);
fprintf (fp, "\"%s\",\n\t\t", v->name);
}
coeff = c->coeff[i];
- v = pspp_linreg_coeff_get_var (coeff, 0);
+ v = pspp_coeff_get_var (coeff, 0);
fprintf (fp, "\"%s\"};\n\t", v->name);
}
static void
for (i = 1; i < c->n_coeffs; i++)
{
- v = pspp_linreg_coeff_get_var (c->coeff[i], 0);
+ v = pspp_coeff_get_var (c->coeff[i], 0);
if (v->type == ALPHA)
{
return 1;
int n_quantiles = 100;
double increment;
double tmp;
- struct pspp_linreg_coeff *coeff;
+ struct pspp_coeff *coeff;
if (export)
{
}
}
static int
-regression_custom_export (struct cmd_regression *cmd UNUSED)
+regression_custom_export (struct cmd_regression *cmd UNUSED, void *aux UNUSED)
{
/* 0 on failure, 1 on success, 2 on failure that should result in syntax error */
if (!lex_force_match ('('))
int
cmd_regression (void)
{
- if (!parse_regression (&cmd))
+ if (!parse_regression (&cmd, NULL))
return CMD_FAILURE;
models = xnmalloc (cmd.n_dependent, sizeof *models);
/* Parser for the variables sub command */
static int
-regression_custom_variables (struct cmd_regression *cmd UNUSED)
+regression_custom_variables (struct cmd_regression *cmd UNUSED,
+ void *aux UNUSED)
{
lex_match ('=');
and store pointers to the variables that correspond to the
coefficients.
*/
- pspp_linreg_coeff_init (models[k], X);
+ pspp_coeff_init (models[k], X);
/*
Find the least-squares estimates and other statistics.