Search code examples
meanmissing-dataspss

SPSS Means With Missing Values


I am averaging the percentages of teaching times of different types of faculty over the span of 3 years. The averaged percentages need to add up to 100%, but they don't because there are missing values. Is there a way to count missing values when I use the mean functions?

'''
    aggregate outfile=* /break car cip control
      / ncount = n
      / {5}
      = mean({0} to {1}).
'''

Solution

  • Assuming you want missing values to count as Zeros, you could either recode them so before aggregating

    recode YourVar (miss=0).
    

    Or without touching the missing values in advance you can use the aggregate command to calculate the sum and the number of rows and afterwards divide sum/n which should give you the mean without discounting the missing values.