Solved – How to enter data for multiple cases simultaneously in SPSS

categorical dataspss

I need to add a new variable to an already existing datafile in SPSS. However, this is a categorical (dichotomous) variable and I have over 30,000 cases, therefore I was wondering if it is possible to enter the same value (i.e. either 0 or 1) for a large number of cases at the same time, so I don't need to enter the data for every individual case.

Best Answer

If you have some logical criteria for the values, just use an IF statement. Or if most of the cases get one of the values, do COMPUTE x=1, say, and then correct the others. Or create a new dataset with just this variable and then use MATCH FILES to add it to the main dataset. Or, if you have a list of case numbers or id's that should get each value, read this with Python code and generate the necessary values.

Whatever you do, avoid manually entering 30,000 values: the error rate will inevitably be terrible.

If you explain the situation further, we can give more specific advice.