Topic
8 replies Latest Post - ‏2012-04-18T22:49:46Z by hryamada
hryamada
hryamada
5 Posts
ACCEPTED ANSWER

Pinned topic Error when using latent class analysis with spss20

‏2012-04-18T01:16:24Z |
Hello - When trying to run latent class analysis, I obtained an error:

STATS LATENT CLASS MANIFESTVARS=Q14_4bi Q14_6bi Q14_12bi Q15_3bi Q15_5bi Q15_6bi Q15_8bi Q16_2bi

>Error # 1. Command name: STATS
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
Q16_3bi Q16_5bi
CLASSES=3
/OPTIONS MISSING=INCLUDE REPETITIONS=10 MAXITER=1000 TOL=.0000000001
/OUTPUT GRAPHS=YES
/SAVE PREDCELLDS=lca.

What do I need to do?

Thanks,
Hiro
Updated on 2012-04-18T22:49:46Z at 2012-04-18T22:49:46Z by hryamada
  • SystemAdmin
    SystemAdmin
    396 Posts
    ACCEPTED ANSWER

    Re: Error when using latent class analysis with spss20

    ‏2012-04-18T01:35:10Z  in response to hryamada
    That error means that the STATS LATENT CLASS command is not installed. You have to download it from the Community site and install the extension bundle. If you did that, you probably didn't have write permission to the necessary directory.

    Look in the Statistics extension directory for the file STATS_LATENT_CLASS.xml. That makes the command recognizable.

    Also remember that you have to restart Statistics before it will recognize a newly install extension command.

    HTH,
    Jon Peck
    • hryamada
      hryamada
      5 Posts
      ACCEPTED ANSWER

      Re: Error when using latent class analysis with spss20

      ‏2012-04-18T02:04:31Z  in response to SystemAdmin
      Hello Jon - As you suggested, I needed to restart SPSS.
      Now I have a new error msg:

      STATS LATENT CLASS MANIFESTVARS=Q14_1bi2 Q14_2bi2 Q14_3bi2 Q14_4bi2 Q14_5bi2 Q14_6bi2 Q14_7bi2
      Q14_8bi2 Q14_9bi2 Q14_10bi2 Q14_11bi2 Q14_12bi2 Q14_13bi2 Q15_1bi2 Q15_2bi2 Q15_3bi2 Q15_4bi2
      Q15_5bi2 Q15_6bi2 Q15_7bi2 Q15_8bi2 Q16_1bi2 Q16_2bi2 Q16_3bi2 Q16_4bi2 Q16_5bi2 Q16_6bi2 Q16_7bi2
      Q16_8bi2 Q16_9bi2
      CLASSES=3
      /OPTIONS MISSING=INCLUDE REPETITIONS=10 MAXITER=1000 TOL=.0000000001
      /OUTPUT GRAPHS=YES.
      Error in terms.formula(object, data = data) :
      variable names are limited to 256 bytes

      Does this mean I need to shorten each variable name? Thanks.
      • SystemAdmin
        SystemAdmin
        396 Posts
        ACCEPTED ANSWER

        Re: Error when using latent class analysis with spss20

        ‏2012-04-18T02:16:26Z  in response to hryamada
        No, but the formula expression being generated for the latent class model is pretty complicated. Can you upload a small dataset that has all these variables defined so that I can see what that formula looks like?

        -Jon Peck
        • hryamada
          hryamada
          5 Posts
          ACCEPTED ANSWER

          Re: Error when using latent class analysis with spss20

          ‏2012-04-18T02:35:13Z  in response to SystemAdmin
          Jon - Attached, please find the spss file. The data are dichotomous (I recoded 1,0 yes/no data into 1,2, b/c the latent class module asks for positive integers). Thanks.
          • SystemAdmin
            SystemAdmin
            396 Posts
            ACCEPTED ANSWER

            Re: Error when using latent class analysis with spss20

            ‏2012-04-18T02:55:17Z  in response to hryamada
            I can reproduce the error using your file. It is happening in the R code estimating the model. I'll dig into this, but not tonight.

            For now, try this with just a few variables. The R code is constructing some internal variables, and shortening the names might help, but I won't know until I dig deeper.

            Regards,
            Jon Peck
            • hryamada
              hryamada
              5 Posts
              ACCEPTED ANSWER

              Re: Error when using latent class analysis with spss20

              ‏2012-04-18T03:03:15Z  in response to SystemAdmin
              Thank you, Jon.
            • SystemAdmin
              SystemAdmin
              396 Posts
              ACCEPTED ANSWER

              Re: Error when using latent class analysis with spss20

              ‏2012-04-18T19:30:03Z  in response to SystemAdmin
              I see that shortening the variable names does allow the procedure to complete, although it doesn't do much for the quality of the output. I have contacted the author of the underlying R package, and he is investigating.

              HTH,
              Jon Peck
              • hryamada
                hryamada
                5 Posts
                ACCEPTED ANSWER

                Re: Error when using latent class analysis with spss20

                ‏2012-04-18T22:49:46Z  in response to SystemAdmin
                Thank you, Jon. Running with fewer variables worked on my end, but at some point, I got an error (indicating "89"), but I don't quite remember what it was. I'm communicating with you in case the R developer you mentioned might know what it is. When I have time, I try to examine more and let you know.

                Regards,
                Hiro