Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

In SPSS, why do the SUM() and MEAN() functions keep cases with missing values instead of dropping those observations?

Statistical functions in SPSS [e.g., SUM(), MEAN(), SD()] perform calculations using all available cases. SPSS will not automatically drop observations with missing values, but instead it will exclude cases with missing values from the calculations. SPSS will correctly estimate the mean with the MEAN() function by using all non-missing values.

However, problems can arise when trying to exclude missing cases and estimate results based only on observations with complete information. For example, suppose two variables (v1 and v2) sum to create an index variable (v3). While v1 has 10 valid cases with no missing values, v2 has 8 valid cases and 2 missing values. Use the following syntax to add the two variables and create an index, v3:

COMPUTE V3 = SUM(V1, V2). EXECUTE .

The resulting index variable v3 has 10 cases and no missing values. When SPSS encounters a missing value in any of the v2 cases, it ignores it and sets v3 equal to v1. Essentially, SPSS treats the missing values of v2 as zeroes. The results can potentially be misleading.

To ensure that v3 is equal to the sum of v1 and v2 and that all missing cases are dropped rather than ignored, specify the minimum number of valid cases that SPSS should use to calculate a given function. For example, to create an index variable v3 using only observations without missing values, execute the following syntax:

COMPUTE V3 = SUM.2(V1, V2). EXECUTE .

The .2 appended to the end of the SUM function in the above example can be any integer. Use it to indicate the minimum number of valid cases necessary to perform a given calculation.

For more about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.

This is document adjn in domain all.
Last modified on December 20, 2011.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.