/[pspp]/pspp/src/regression.q
ViewVC logotype

Diff of /pspp/src/regression.q

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by jstover, Tue Oct 18 19:42:02 2005 UTC revision 1.6 by jstover, Tue Oct 18 19:49:21 2005 UTC
# Line 100  reg_stats_r (pspp_linreg_cache * c) Line 100  reg_stats_r (pspp_linreg_cache * c)
100    double rsq;    double rsq;
101    double adjrsq;    double adjrsq;
102    double stderr;    double stderr;
103      
104    assert (c != NULL);    assert (c != NULL);
105    rsq = c->ssm / c->sst;    rsq = c->ssm / c->sst;
106    adjrsq = 1.0 - (1.0 - rsq) * (c->n_obs - 1.0) / (c->n_obs - c->n_indeps);    adjrsq = 1.0 - (1.0 - rsq) * (c->n_obs - 1.0) / (c->n_obs - c->n_indeps);
107    stderr = sqrt (2 * (c->n_indeps - 1.0) / (c->n_obs - 1.0));    stderr = sqrt ((c->n_indeps - 1.0) / (c->n_obs - 1.0));
108    t = tab_create (n_cols, n_rows, 0);    t = tab_create (n_cols, n_rows, 0);
109    tab_dim (t, tab_natural_dimensions);    tab_dim (t, tab_natural_dimensions);
110    tab_box (t, TAL_2, TAL_2, -1, TAL_1, 0, 0, n_cols - 1, n_rows - 1);    tab_box (t, TAL_2, TAL_2, -1, TAL_1, 0, 0, n_cols - 1, n_rows - 1);
111    tab_hline (t, TAL_2, 0, n_cols - 1, 1);    tab_hline (t, TAL_2, 0, n_cols - 1, 1);
112    tab_vline (t, TAL_2, 2, 0, n_rows - 1);    tab_vline (t, TAL_2, 2, 0, n_rows - 1);
113    tab_vline (t, TAL_0, 1, 0, 0);    tab_vline (t, TAL_0, 1, 0, 0);
114      
115    tab_text (t, 1, 0, TAB_CENTER | TAT_TITLE, _("R"));    tab_text (t, 1, 0, TAB_CENTER | TAT_TITLE, _("R"));
116    tab_text (t, 2, 0, TAB_CENTER | TAT_TITLE, _("R Square"));      tab_text (t, 2, 0, TAB_CENTER | TAT_TITLE, _("R Square"));
117    tab_text (t, 3, 0, TAB_CENTER | TAT_TITLE, _("Adjusted R Square"));      tab_text (t, 3, 0, TAB_CENTER | TAT_TITLE, _("Adjusted R Square"));
118    tab_text (t, 4, 0, TAB_CENTER | TAT_TITLE, _("Std. Error of the Estimate"));        tab_text (t, 4, 0, TAB_CENTER | TAT_TITLE, _("Std. Error of the Estimate"));
119    tab_float (t, 1, 1, TAB_RIGHT, sqrt(rsq), 10, 2);    tab_float (t, 1, 1, TAB_RIGHT, sqrt (rsq), 10, 2);
120    tab_float (t, 2, 1, TAB_RIGHT, rsq, 10, 2);    tab_float (t, 2, 1, TAB_RIGHT, rsq, 10, 2);
121    tab_float (t, 3, 1, TAB_RIGHT, adjrsq, 10, 2);    tab_float (t, 3, 1, TAB_RIGHT, adjrsq, 10, 2);
122    tab_float (t, 4, 1, TAB_RIGHT, stderr, 10, 2);    tab_float (t, 4, 1, TAB_RIGHT, stderr, 10, 2);
# Line 522  run_regression (const struct casefile *c Line 522  run_regression (const struct casefile *c
522             */             */
523            if (is_depvar (i))            if (is_depvar (i))
524              {              {
525                assert(v->type == NUMERIC);                assert (v->type == NUMERIC);
526                gsl_vector_set (Y, row, val->f);                gsl_vector_set (Y, row, val->f);
527              }              }
528            else            else

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26