## Regression - exclude cases pairwise

Regular Contributor
Posts: 188

# Regression - exclude cases pairwise

Hi,

I'm converting a regression analysis from spss tot sas.
The spss regression uses the exclude cases pairwise option:

The exclude cases pairwise option will report statistics based on all the available valid data. If there are missing values then the n's may be different for the reported statistics.

From the SAS docs I found that SAS uses an exclude cases listwise approach:
The exclude cases listwise option (the default) will delete the entire case from the analysis if any value in either the dependent list or the factor list is missing. This option results in equal n's for the reported statistics.

According to the spss docs:
Exclude cases pairwise. Cases with complete data for the pair of variables being correlated are used to compute the correlation coefficient on which the regression analysis is based. Degrees of freedom are based on the minimum pairwise N.

How can I get exclude cases pairwise behaviour for proc reg in SAS?

Thanks,
Bart
Super Contributor
Posts: 281

## Re: Regression - exclude cases pairwise

Posted in reply to bheinsius
I think you would have to write a macro that loops through all pairs of independent and dependent variables.
Regular Contributor
Posts: 188

## Re: Regression - exclude cases pairwise

I'm not a real statistics guy. Could you explain some more?
Super Contributor
Posts: 281

## Re: Regression - exclude cases pairwise

Posted in reply to bheinsius
You write a macro that does the regression of X1 and Y1, then X2 and Y1, and so on, storing the results of each.
Trusted Advisor
Posts: 2,116

## Re: Regression - exclude cases pairwise

Posted in reply to bheinsius
I'd be hesitant to do the pairwise deletion approach. There is some serious bias potential in this ad hoc procedure.

A principled approach to using all the data is to use PROC MI to impute the missing data and then do the analyses and use PROC MIANALYZE to summarize the results.

Doc Muhlbaier
Duke
SAS Employee
Posts: 306

## Re: Regression - exclude cases pairwise

Posted in reply to bheinsius
Doc's points are well taken and imputation is probably the better approach. But to answer your specific question, you can fit a regression model using pairwise deletion of missing values by first computing the correlation matrix among the model variables and then using the correlation matrix as input to PROC REG rather than the original data. PROC CORR computes the correlation matrix and uses pairwise deletion by default (specify the NOMISS option to use listwise deletion). In the log, REG reminds you that the sample sizes are not equal across the variables, and it then uses the smallest as the sample size for the analysis. Here is an example:

proc corr data=MyData out=CorrMx;
var y x1 x2 x3;
run;
proc reg data=CorrMx;
model y=x1 x2 x3;
run;
Regular Contributor
Posts: 188

## Re: Regression - exclude cases pairwise

Posted in reply to StatDave_sas
Thanks all for your answers.
I will start off with StatDave's suggestion since it sounds the simplest for this moment.
Discussion stats
• 6 replies
• 1674 views
• 0 likes
• 4 in conversation