Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

SPSS FAQ How can I count how many cases are missing in a string variable?

cases MISSING SPSS String
0
Posted

SPSS FAQ How can I count how many cases are missing in a string variable?

0

There are at least two ways to find out how many missing cases there are in a string variable. The first way is to use the missing values command to define a missing value for the variable. The second way is to create a new variable which is zero if the value is not missing and one if it is missing. To do that, you will need to use the length and the trim functions with the compute command. Consider the data set below. We have two string variables, fname (first name) and lname (last name). Because we have given fname a length of five and lname a length of eight, both variables are short string variables. (Note that if we had just typed (A), the length of the string variable would have been one, not the length of the first case, as it would have been in other statistical packages, such as SAS.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.