SPSS: Why the sample size changes between analyses
If the sample size decreases from one analysis to the next in SPSS, it is usually not a software error. When asking “SPSS: why does the sample size change between analyses?”, it almost always has to do with which cases are actually usable for the respective procedure. Even a single missing piece of information, an active filter, or an additional control variable can cause SPSS to include different people in the calculation.
This is relevant for theses and publications because not only the sample size, but also estimates, p-values, confidence intervals, and the substantive meaning of a model can change. Therefore, the goal is not to force the same sample size everywhere. The goal is to check differences systematically and report them transparently.
What the sample size actually means in SPSS
The displayed sample size is not always the total number of rows in your data file. It usually refers to the cases that SPSS used for that specific calculation. For example, a person may have provided information on age, gender, and a scale, but skipped a question about income. In a descriptive analysis without income, this case can be included. As soon as income becomes part of the model, the case may be excluded.
Also pay attention to which sample size is meant in the output. Depending on the procedure, SPSS displays the total number of cases, the number of valid cases, the number of excluded cases, or the number of cases in individual groups. In linear regression, the sample size that is most important is the one reported under “Model Summary” or in the case processing information for the model. In contrast, cross-tabulations may show different reference sizes depending on the cell, row, or column.
SPSS: Why the sample size changes between analyses
The most common explanation is missing values. SPSS distinguishes between system-defined missing values, such as an empty cell, and user-defined missing values. The latter often arise from coding such as 99 for “no response” or -9 for “don’t know.” Only if such codes are correctly defined as missing in the variable view will SPSS treat them as missing information rather than as actual measurements.
How much missing values reduce the sample size depends on the analysis procedure. Many procedures use listwise exclusion by default. This means: A case is completely removed from the analysis if at least one variable included in the model is missing a value. If a regression includes the dependent variable, three predictors, and two control variables, a valid value must be available for all six variables.
This also explains why the sample size may decrease with each expanded model. A model with age and gender may use 280 cases. If a variable for social support is additionally added, for which 25 people did not provide information, the analyzed sample size may be reduced to 255. Whether this reduction is problematic depends on how many values are missing and whether the missingness is systematic.
Pairwise instead of listwise exclusion
Not every procedure works the same way. In correlation analyses, SPSS can use pairwise exclusion depending on the setting. Then the maximum number of available cases is used for each pair of variables. The correlation between stress and sleep may be based on 270 cases, while that between stress and income may be based on only 230 cases.
This uses the available data more efficiently, but makes it harder to compare the coefficients. Different correlations may then be based on different subsamples. For a clear correlation matrix in a scientific paper, listwise exclusion may make more sense, provided that the resulting loss of information is acceptable. The appropriate decision depends on the research question, data structure, and extent of missing values.
Filters, case selection, and group division
A second typical cause is settings that remain active in the background. Under “Data,” cases may have been selected or filtered, for example, only people from an intervention group, only complete questionnaires, or only participants of a certain age or older. SPSS often marks filtered cases with a crossed-out row number in the data view. They remain in the file but are not analyzed.
“Split file” can also be confusing. If the file is split by study group, for example, SPSS performs the same analysis separately for the control and intervention groups. The sample size per table is then smaller than the total sample. In addition, if values are missing within a group, the valid sample sizes can vary significantly between the groups.
Also check whether a weighting variable is enabled. Weighting does not necessarily change the number of data records, but the effective or weighted sample size reported in the output may appear different from the number of actual respondents. In the methods section, the unweighted sample size and, if applicable, the weight used should be clearly distinguished.
Additional variables change the analyzable sample
The difference is particularly noticeable in regression, variance, and mediation analyses. Every variable you add represents an additional condition for a case to be included. This includes not only main variables, but also covariates, interaction terms, group variables, and variables for repeated measurements.
For example: You are investigating whether test anxiety predicts performance. The simple regression uses all people who provided information on test anxiety and performance. In the second model, you control for semester and employment. If information on employment is missing, these people are excluded from the second model. If these people differ systematically from the others in their test anxiety or performance, you are no longer comparing exactly the same sample.
Additional requirements apply to repeated measures analyses. If you are comparing, for example, a pre- and a post-value, classic procedures often require both measurements from the same person. Anyone who only participated at the first measurement point will be excluded from the complete analysis. Linear Mixed Models can often handle incomplete measurement series better, but they also require professionally justified modeling and a check of the assumptions.
How to systematically check the cause
Do not start by comparing individual p-values, but with case processing. Generate frequencies or descriptive statistics for all variables that appear in an analysis. This will quickly show you which variables have valid and missing values that differ from each other. For scales, you should also check whether missing individual items were combined into a scale value according to a pre-defined rule.
Then compare the variables of the analyses step by step. Note which variable is added to the model first, resulting in a smaller sample size. Often, the difference can be directly attributed to this variable. At the same time, check under “Data” whether “Select Cases,” “Split File,” or “Weight Cases” is active. Before a new analysis, these settings should be deliberately set or reset.
A useful check is an indicator variable for analyzability: cases with complete values receive, for example, the value 1, while cases with at least one missing model value receive the value 0. You can then descriptively check whether the two groups differ on key characteristics. This does not replace a comprehensive missing data analysis, but it shows whether the exclusion may be selective.
Do not replace missing values too hastily
The desire for a uniform sample size sometimes leads to replacing missing values generally with means. This is rarely a good standard solution. Mean imputation typically underestimates the actual uncertainty and can distort variances and relationships.
For a few plausibly randomly missing pieces of information, listwise exclusion may be sufficient. For larger or systematic missingness, methods such as multiple imputation or model-based procedures may be appropriate depending on the research question. However, these procedures are not automatic repair functions: they require a meaningful imputation model, suitable auxiliary variables, and transparent documentation. Which strategy is appropriate depends on the mechanism of the missing values, the amount of data, and the planned analysis procedure.
Report sample sizes correctly
In the results section, it is usually not enough to mention the original total sample size once. Provide the sample size actually used for key analyses, especially if it varies between models. A factual formulation could be: “Due to missing values, the regression analysis is based on n = 255 cases.” For multiple models, it is useful to report the respective sample size directly in the table or table note.
Also describe in the methods section how missing values were handled, whether cases were filtered, and according to what criteria scales were created. This allows readers to understand why the sample size varies. Transparency is methodologically stronger here than trying to make differences invisible.
If the sample size in your SPSS output jumps unexpectedly, check the missing values and active data options first before changing the analysis procedure. For complex datasets or important model decisions, individual statistical advice can help to properly align exclusion rules, missing data strategy, and reporting for your specific research question. You can inquire about your project confidentially via the Easy Statistik contact form.