BookmarkSubscribeRSS Feed
bheinsius
Lapis Lazuli | Level 10
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
6 REPLIES 6
Paige
Quartz | Level 8
I think you would have to write a macro that loops through all pairs of independent and dependent variables.
bheinsius
Lapis Lazuli | Level 10
I'm not a real statistics guy. Could you explain some more?
Paige
Quartz | Level 8
You write a macro that does the regression of X1 and Y1, then X2 and Y1, and so on, storing the results of each.
Doc_Duke
Rhodochrosite | Level 12
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
StatDave
SAS Super FREQ
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;
bheinsius
Lapis Lazuli | Level 10
Thanks all for your answers.
I will start off with StatDave's suggestion since it sounds the simplest for this moment.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 4071 views
  • 0 likes
  • 4 in conversation