enum extraction_method extraction;
enum plot_opts plot;
enum rotation_type rotation;
+ int rotation_iterations;
/* Extraction Criteria */
int n_factors;
double min_eigen;
double econverge;
- int iterations;
+ int extraction_iterations;
double rconverge;
/* Now perform the rotation iterations */
prev_sv = initial_sv (normalised);
- for (i = 0 ; i < cf->iterations ; ++i)
+ for (i = 0 ; i < cf->rotation_iterations ; ++i)
{
double sv = 0.0;
for (j = 0 ; j < normalised->size2; ++j)
int
cmd_factor (struct lexer *lexer, struct dataset *ds)
{
- bool extraction_seen = false;
const struct dictionary *dict = dataset_dict (ds);
-
+ int n_iterations = 25;
struct cmd_factor factor;
factor.n_vars = 0;
factor.vars = NULL;
factor.extraction = EXTRACTION_PC;
factor.n_factors = 0;
factor.min_eigen = SYSMIS;
- factor.iterations = 25;
+ factor.extraction_iterations = 25;
+ factor.rotation_iterations = 25;
factor.econverge = 0.001;
factor.blank = 0;
goto error;
}
}
+ factor.rotation_iterations = n_iterations;
}
else if (lex_match_id (lexer, "CRITERIA"))
{
if ( lex_force_match (lexer, T_LPAREN))
{
lex_force_int (lexer);
- factor.iterations = lex_integer (lexer);
+ n_iterations = lex_integer (lexer);
lex_get (lexer);
lex_force_match (lexer, T_RPAREN);
}
{
factor.n_factors = 0;
factor.min_eigen = 1;
- factor.iterations = 25;
+ n_iterations = 25;
}
else
{
}
else if (lex_match_id (lexer, "EXTRACTION"))
{
- extraction_seen = true;
lex_match (lexer, T_EQUALS);
while (lex_token (lexer) != T_ENDCMD && lex_token (lexer) != T_SLASH)
{
goto error;
}
}
+ factor.extraction_iterations = n_iterations;
}
else if (lex_match_id (lexer, "FORMAT"))
{
tab_text (t, c++, i + heading_rows, TAT_TITLE, var_to_string (factor->vars[i]));
if (factor->print & PRINT_INITIAL)
- tab_double (t, c++, i + heading_rows, 0, gsl_vector_get (initial, i), NULL);
+ tab_double (t, c++, i + heading_rows, 0, gsl_vector_get (initial, i), NULL, RC_OTHER);
if (factor->print & PRINT_EXTRACTION)
- tab_double (t, c++, i + heading_rows, 0, gsl_vector_get (extracted, i), NULL);
+ tab_double (t, c++, i + heading_rows, 0, gsl_vector_get (extracted, i), NULL, RC_OTHER);
}
tab_submit (t);
if ( fabs (x) < factor->blank)
continue;
- tab_double (t, heading_columns + j, heading_rows + i, 0, x, NULL);
+ tab_double (t, heading_columns + j, heading_rows + i, 0, x, NULL, RC_OTHER);
}
}
/* Initial Eigenvalues */
if (factor->print & PRINT_INITIAL)
{
- tab_double (t, c++, i + heading_rows, 0, i_lambda, NULL);
- tab_double (t, c++, i + heading_rows, 0, i_percent, NULL);
- tab_double (t, c++, i + heading_rows, 0, i_cum, NULL);
+ tab_double (t, c++, i + heading_rows, 0, i_lambda, NULL, RC_OTHER);
+ tab_double (t, c++, i + heading_rows, 0, i_percent, NULL, RC_OTHER);
+ tab_double (t, c++, i + heading_rows, 0, i_cum, NULL, RC_OTHER);
}
if (i < idata->n_extractions)
{
/* Sums of squared loadings */
- tab_double (t, c++, i + heading_rows, 0, e_lambda, NULL);
- tab_double (t, c++, i + heading_rows, 0, e_percent, NULL);
- tab_double (t, c++, i + heading_rows, 0, e_cum, NULL);
+ tab_double (t, c++, i + heading_rows, 0, e_lambda, NULL, RC_OTHER);
+ tab_double (t, c++, i + heading_rows, 0, e_percent, NULL, RC_OTHER);
+ tab_double (t, c++, i + heading_rows, 0, e_cum, NULL, RC_OTHER);
}
}
if (i < idata->n_extractions)
{
r_cum += r_percent;
- tab_double (t, c++, i + heading_rows, 0, r_lambda, NULL);
- tab_double (t, c++, i + heading_rows, 0, r_percent, NULL);
- tab_double (t, c++, i + heading_rows, 0, r_cum, NULL);
+ tab_double (t, c++, i + heading_rows, 0, r_lambda, NULL, RC_OTHER);
+ tab_double (t, c++, i + heading_rows, 0, r_percent, NULL, RC_OTHER);
+ tab_double (t, c++, i + heading_rows, 0, r_cum, NULL, RC_OTHER);
}
}
}
for (i = 0; i < factor->n_vars; ++i)
{
for (j = 0; j < factor->n_vars; ++j)
- tab_double (t, heading_columns + i, y + j, 0, gsl_matrix_get (idata->corr, i, j), NULL);
+ tab_double (t, heading_columns + i, y + j, 0, gsl_matrix_get (idata->corr, i, j), NULL, RC_OTHER);
}
}
if (i == j)
continue;
- tab_double (t, heading_columns + i, y + j, 0, significance_of_correlation (rho, w), NULL);
+ tab_double (t, heading_columns + i, y + j, 0, significance_of_correlation (rho, w), NULL, RC_PVALUE);
}
}
}
{
tab_text (t, 0, nr, TAB_LEFT | TAT_TITLE, _("Determinant"));
- tab_double (t, 1, nr, 0, idata->detR, NULL);
+ tab_double (t, 1, nr, 0, idata->detR, NULL, RC_OTHER);
}
tab_submit (t);
const int nr = heading_rows + factor->n_vars;
struct tab_table *t = tab_create (nc, nr);
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_title (t, _("Descriptive Statistics"));
tab_headers (t, heading_columns, 0, heading_rows, 0);
const struct variable *v = factor->vars[i];
tab_text (t, 0, i + heading_rows, TAB_LEFT | TAT_TITLE, var_to_string (v));
- tab_double (t, 1, i + heading_rows, 0, gsl_matrix_get (mean_matrix, i, i), NULL);
- tab_double (t, 2, i + heading_rows, 0, sqrt (gsl_matrix_get (var_matrix, i, i)), NULL);
- tab_double (t, 3, i + heading_rows, 0, gsl_matrix_get (idata->n, i, i), wfmt);
+ tab_double (t, 1, i + heading_rows, 0, gsl_matrix_get (mean_matrix, i, i), NULL, RC_OTHER);
+ tab_double (t, 2, i + heading_rows, 0, sqrt (gsl_matrix_get (var_matrix, i, i)), NULL, RC_OTHER);
+ tab_double (t, 3, i + heading_rows, 0, gsl_matrix_get (idata->n, i, i), NULL, RC_WEIGHT);
}
tab_submit (t);
tab_text (t, 0, 0, TAT_TITLE | TAB_LEFT, _("Kaiser-Meyer-Olkin Measure of Sampling Adequacy"));
- tab_double (t, 2, 0, 0, sum_ssq_r / (sum_ssq_r + sum_ssq_a), NULL);
+ tab_double (t, 2, 0, 0, sum_ssq_r / (sum_ssq_r + sum_ssq_a), NULL, RC_OTHER);
tab_text (t, 0, 1, TAT_TITLE | TAB_LEFT, _("Bartlett's Test of Sphericity"));
xsq = w - 1 - (2 * factor->n_vars + 5) / 6.0;
xsq *= -log (idata->detR);
- tab_double (t, 2, 1, 0, xsq, NULL);
- tab_double (t, 2, 2, 0, df, &F_8_0);
- tab_double (t, 2, 3, 0, gsl_cdf_chisq_Q (xsq, df), NULL);
+ tab_double (t, 2, 1, 0, xsq, NULL, RC_OTHER);
+ tab_double (t, 2, 2, 0, df, NULL, RC_INTEGER);
+ tab_double (t, 2, 3, 0, gsl_cdf_chisq_Q (xsq, df), NULL, RC_PVALUE);
tab_submit (t);
if (idata->n_extractions == 0)
{
- msg (MW, _("The FACTOR criteria result in zero factors extracted. Therefore no analysis will be performed."));
+ msg (MW, _("The %s criteria result in zero factors extracted. Therefore no analysis will be performed."), "FACTOR");
goto finish;
}
if (idata->n_extractions > factor->n_vars)
{
- msg (MW, _("The FACTOR criteria result in more factors than variables, which is not meaningful. No analysis will be performed."));
+ msg (MW,
+ _("The %s criteria result in more factors than variables, which is not meaningful. No analysis will be performed."),
+ "FACTOR");
goto finish;
}
gsl_vector_memcpy (initial_communalities, idata->msr);
- for (i = 0; i < factor->iterations; ++i)
+ for (i = 0; i < factor->extraction_iterations; ++i)
{
double min, max;
gsl_vector_memcpy (diff, idata->msr);