SPSS Statistics

SPSS Statistics

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

 View Only
  • 1.  Coding categorical data - fastest way via variable view

    Posted Mon August 24, 2020 06:56 PM

    Hi,

    I assigned numbers to my categorical data in the SPSS variable view to perform analysis. However, when using the 1-A button nothing happens unless I click on each single cell manually (where the categorical data still shows). This approach is too time consuming, having a large sample size. Any suggestions how to speed this up? I did not enter the data manually but transferred a file from Excel. Thank you.

    Tanya






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: Coding categorical data - fastest way via variable view

    Posted Mon August 24, 2020 08:06 PM

    I'm not sure what you are trying to do in the Data Editor, but consider using Autorecode (Transform > Automatic Recode) to turn strings into numerical codes.

    And, if you need to create a basis of dummy variables for a categorical variable (string or numeric), check out the SPSSINC CREATE DUMMIES etension command. You can install it from the Extensions > Extension Hub menu.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 3.  RE: Coding categorical data - fastest way via variable view

    Posted Mon August 24, 2020 08:20 PM

    Thanks for your comment. What I mean is that, e.g., I have the variable gender and four different answer categories (male, female, third gender, prefer not to say). I am trying to assign numbers to each of the four categories, i.e. 1=male, 2=female, 3=third gender, 4=prefer not to say). I entered this info in the variable view (coding the answers, so I can apply the chosen statistical test). However, when I return to data view (and click the 1-A option, the coded numbers do not appear until I click on each single answer manually. I hope my question is clearer now. Thanks.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 4.  RE: Coding categorical data - fastest way via variable view

    Posted Mon August 24, 2020 08:27 PM

    I think you are saying that you have defined value labels for 1-4. Then, in the Data View, you can just type the numbers even if the labels are showing. You don't need to click and drop down the label list. But if the numerical values have already been entered, you can just use the data as is or even turn the value labels off in Data View They will still appear in the output.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 5.  RE: Coding categorical data - fastest way via variable view

    Posted Mon August 24, 2020 09:39 PM

    Thanks. The extension is installed. If you click on the link and (Support Member) you can find an example of what I am trying to do https://www.youtube.com/watch?v=DIifxbt7LaI&t=409s






    #SPSSStatistics
    #Support
    #SupportMigration


  • 6.  RE: Coding categorical data - fastest way via variable view

    Posted Mon August 24, 2020 09:57 PM

    This seems different from what I thought you were asking about. The entries in the Chi-squared dialog box are the proportions of the categories. From the dialog help...


    Expected Values. By default, all categories have equal expected values. Categories can have user-specified expected proportions. Select Values, enter a value that is greater than 0 for each category of the test variable, and then click Add. Each time you add a value, it appears at the bottom of the value list. The order of the values is important; it corresponds to the ascending order of the category values of the test variable. The first value of the list corresponds to the lowest group value of the test variable, and the last value corresponds to the highest value. Elements of the value list are summed, and then each value is divided by this sum to calculate the proportion of cases expected in the corresponding category. For example, a value list of 3, 4, 5, 4 specifies expected proportions of 3/16, 4/16, 5/16, and 4/16.


    But if you prefer, you can use syntax like this if gender is numeric.

    NPAR TESTS

     /CHISQUARE=gender

     /EXPECTED=.5 .5.


    If it is a string type, run AUTORECODE as previously discussed first and use that result here. Or use Nonparametric Tests> One Sample, which accepts string or numeric variables.








    #SPSSStatistics
    #Support
    #SupportMigration


  • 7.  RE: Coding categorical data - fastest way via variable view

    Posted Mon August 24, 2020 11:49 PM

    'Recode into different variables' worked. Thanks.






    #SPSSStatistics
    #Support
    #SupportMigration