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?
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;
proc reg data=CorrMx;
model y=x1 x2 x3;