FACTOR: Check that the number of factors does not exceed the number of variables
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 28 Dec 2009 10:45:26 +0000 (11:45 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Mon, 28 Dec 2009 10:45:26 +0000 (11:45 +0100)
src/language/stats/factor.c

index 72a066408bb9f09e95fd863acaf40fe88888a332..cfec4a9a40890d7eb09a4c6bbdcc05c98d810bcd 100644 (file)
@@ -1467,6 +1467,12 @@ do_factor (const struct cmd_factor *factor, struct casereader *r)
       msg (MW, _("The FACTOR criteria result in zero factors extracted. Therefore no analysis will be performed."));
       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."));
+      goto finish;
+    }
     
   {
     const gsl_vector *extracted_eigenvalues = NULL;