SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
Expand all | Collapse all

Assign Latent Class Analysis Variable

  • 1.  Assign Latent Class Analysis Variable

    Posted Tue October 13, 2020 03:15 PM

    Hi. I have run Latent Class Analysis on my data using the Extensions utility. While it creates three groups, there's no variable indicating which respondent belongs in which group. (When I try to assign a variable to hold the scores, the variable stays blank.) Can someone assist? Thx!






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: Assign Latent Class Analysis Variable
    Best Answer

    Posted Wed October 14, 2020 12:52 PM

    The predicted class and related information are saved to a new dataset that you specify. You need to include an ID variable if using this feature so that you can merge these variables into your main dataset.

    Here is an example syntax using the employee data.sav file shipped with Statistics.

    STATS LATENT CLASS MANIFESTVARS=educ jobcat COVARIATES=jobtime prevexp CLASSES=3

    /OPTIONS MISSING=INCLUDE REPETITIONS=10 MAXITER=1000 TOL=.0000000001

    /OUTPUT GRAPHS=YES

    /SAVE SCOREDS=predicted IDVAR=id






    #SPSSStatistics
    #Support
    #SupportMigration


  • 3.  RE: Assign Latent Class Analysis Variable
    Best Answer

    Posted Wed October 14, 2020 01:25 PM

    Thank you, Jon. When I try running it, I get this error message:

    Dataset name for keyword PREDCELLDS of subcommand SAVE is missing or invalid.

    So what am I doing wrong?






    #SPSSStatistics
    #Support
    #SupportMigration


  • 4.  RE: Assign Latent Class Analysis Variable
    Best Answer

    Posted Wed October 14, 2020 01:33 PM

    Please paste and post your syntax.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 5.  RE: Assign Latent Class Analysis Variable
    Best Answer

    Posted Wed October 14, 2020 01:41 PM

    Here we go:


    STATS LATENT CLASS MANIFESTVARS=Q9A_01 Q9A_02 Q9A_03 Q9A_04 Q9A_05 Q9A_06 Q9A_07 Q9A_08 Q9A_09

      Q9A_10 Q9A_11 Q9A_12 Q9A_13 Q9B_01 Q9B_02 Q9B_03 Q9B_04 Q9B_05 Q9B_06 Q9B_07 Q9B_08 Q9B_09 Q9B_10

      Q9B_11 Q9B_12 Q9B_13 Q9C_01 Q9C_02 Q9C_03 Q9C_04 Q9C_05 Q9C_06 Q9C_07 Q9C_08 Q9C_09 Q9C_10 Q9C_11

      Q9C_12 Q9C_13 Q9D_01 Q9D_02 Q9D_03 Q9D_04 Q9D_05 Q9D_06 Q9D_07 Q9D_08 Q9D_09 Q9D_10 Q9D_11 Q9D_12

      Q9D_13

    CLASSES=3

    /OPTIONS MISSING=INCLUDE REPETITIONS=10 MAXITER=1000 TOL=.0000000001

    /OUTPUT GRAPHS=YES

    /SAVE PREDCELLDS=2580 Harris Data 4A SCOREDS=2580 Harris Data 4B IDVAR=responseID FILLER=IGNORE.







    #SPSSStatistics
    #Support
    #SupportMigration


  • 6.  RE: Assign Latent Class Analysis Variable
    Best Answer

    Posted Wed October 14, 2020 01:44 PM

    Dataset names follow the same rules as variable names, so they have to start with a letter and cannot contain blanks.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 7.  RE: Assign Latent Class Analysis Variable
    Best Answer

    Posted Wed October 14, 2020 02:29 PM

    That did it. Thank you, sir!






    #SPSSStatistics
    #Support
    #SupportMigration