#include <output/table.h>
+#include <output/charts/scree.h>
+#include <output/chart.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
EXTRACTION_PAF,
};
+enum plot_opts
+ {
+ PLOT_SCREE = 0x0001,
+ PLOT_ROTATION = 0x0002
+ };
+
enum print_opts
{
PRINT_UNIVARIATE = 0x0001,
enum mv_class exclude;
enum print_opts print;
enum extraction_method extraction;
+ enum plot_opts plot;
/* Extraction Criteria */
int n_factors;
factor.econverge = 0.001;
factor.blank = 0;
factor.sort = false;
+ factor.plot = 0;
factor.wv = dict_get_weight (dict);
{
lex_match (lexer, '/');
-#if FACTOR_FULLY_IMPLEMENTED
if (lex_match_id (lexer, "PLOT"))
{
lex_match (lexer, '=');
{
if (lex_match_id (lexer, "EIGEN"))
{
+ factor.plot |= PLOT_SCREE;
}
+#if FACTOR_FULLY_IMPLEMENTED
else if (lex_match_id (lexer, "ROTATION"))
{
}
+#endif
else
{
lex_error (lexer, NULL);
}
}
}
- else
-#endif
- if (lex_match_id (lexer, "METHOD"))
+ else if (lex_match_id (lexer, "METHOD"))
{
lex_match (lexer, '=');
while (lex_token (lexer) != '.' && lex_token (lexer) != '/')
}
+static void
+show_scree (const struct cmd_factor *f, struct idata *idata)
+{
+ struct scree *s;
+ const char *label ;
+
+ if ( !(f->plot & PLOT_SCREE) )
+ return;
+
+
+ label = f->extraction == EXTRACTION_PC ? _("Component Number") : _("Factor Number");
+
+ s = scree_create (idata->eval, label);
+
+ chart_submit (scree_get_chart (s));
+}
static void
show_communalities (const struct cmd_factor * factor,
if (nc <= 1)
return;
- t = tab_create (nc, nr, 0);
+ t = tab_create (nc, nr);
tab_title (t, _("Communalities"));
- tab_dim (t, tab_natural_dimensions, NULL);
+ tab_dim (t, tab_natural_dimensions, NULL, NULL);
tab_headers (t, heading_columns, 0, heading_rows, 0);
const int nc = heading_columns + n_factors;
gsl_permutation *perm;
- struct tab_table *t = tab_create (nc, nr, 0);
+ struct tab_table *t = tab_create (nc, nr);
if ( factor->extraction == EXTRACTION_PC )
tab_title (t, _("Component Matrix"));
else
tab_title (t, _("Factor Matrix"));
- tab_dim (t, tab_natural_dimensions, NULL);
+ tab_dim (t, tab_natural_dimensions, NULL, NULL);
tab_headers (t, heading_columns, 0, heading_rows, 0);
if ( nc <= heading_columns)
return;
- t = tab_create (nc, nr, 0);
+ t = tab_create (nc, nr);
tab_title (t, _("Total Variance Explained"));
- tab_dim (t, tab_natural_dimensions, NULL);
+ tab_dim (t, tab_natural_dimensions, NULL, NULL);
tab_headers (t, heading_columns, 0, heading_rows, 0);
if (nr <= heading_rows && suffix_rows == 0)
return;
- t = tab_create (nc, nr + suffix_rows, 0);
+ t = tab_create (nc, nr + suffix_rows);
tab_title (t, _("Correlation Matrix"));
- tab_dim (t, tab_natural_dimensions, NULL);
+ tab_dim (t, tab_natural_dimensions, NULL, NULL);
tab_hline (t, TAL_1, 0, nc - 1, heading_rows);
const int nr = heading_rows + factor->n_vars;
- struct tab_table *t = tab_create (nc, nr, 0);
+ struct tab_table *t = tab_create (nc, nr);
tab_title (t, _("Descriptive Statistics"));
- tab_dim (t, tab_natural_dimensions, NULL);
+ tab_dim (t, tab_natural_dimensions, NULL, NULL);
tab_headers (t, heading_columns, 0, heading_rows, 0);
factor_matrix_workspace_free (fmw);
+ show_scree (factor, idata);
+
show_factor_matrix (factor, idata, factor_matrix);
gsl_vector_free (initial_communalities);