turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Forecasting
- /
- How differently do SAS and STATA deal with missing...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-15-2015 09:44 AM

I use both SAS and STATA to run a log-linear regression with the same dataset. The coefficient magnitudes were somehow different. One of the variables in my dataset had 18% missing values. I was wondering whether it was because SAS applied imputation when running regression.

Anyone knows the difference between SAS and STATA in running regression for data with missing values?

Thanks a lot.

Accepted Solutions

Solution

04-15-2015
11:13 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-15-2015 11:13 AM

All Replies

Solution

04-15-2015
11:13 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-15-2015 11:13 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-15-2015 12:11 PM

Thanks, Ballard.

But when I run the data with missing values excluded, the result was different from that given by not excluding missing values on purpose. The key difference is that coefficient values were totally different.

I'm attaching my data in my thread. The way I used was:

proc reg data=temp;

model lcost_all_adj=age_diag_gp1 age_diag_gp2 age_diag_gp4 age_diag_gp5 mhi_grp2 mhi_grp3 mhi_grp4 days_debr_grp2 days_debr_grp3 days_debr_grp4 flap

negpthp days_dswi_grp2 days_dswi_grp3 days_dswi_grp4 los_cs_grp2 los_cs_grp3 los_cs_grp4 los_cs_grp5 comorbid_grp2 comorbid_grp3

sepsis transf_bleedcomp;

run;

This gave me corrected total of 1198, as shown below:

Number of Observations Read | 1198 |
---|---|

Number of Observations Used | 1198 |

Analysis of Variance | |||||

Source | DF | Sum of Squares | Mean Square | F Value | Pr>F |

Model | 23 | 441.70924 | 19.20475 | 24.58 | <.0001 |
---|---|---|---|---|---|

Error | 1174 | 917.16903 | 0.78123 | ||

Corrected Total | 1197 | 1358.87827 |

However, when I particularly excluded the missing values, as below

proc reg data=temp;

model lcost_all_adj=age_diag_gp1 age_diag_gp2 age_diag_gp4 age_diag_gp5 mhi_grp2 mhi_grp3 mhi_grp4 days_debr_grp2 days_debr_grp3 days_debr_grp4 flap

negpthp days_dswi_grp2 days_dswi_grp3 days_dswi_grp4 los_cs_grp2 los_cs_grp3 los_cs_grp4 los_cs_grp5 comorbid_grp2 comorbid_grp3

sepsis transf_bleedcomp;

where mhi_ctg^=.;

run;

I have

Number of Observations Read | 992 |
---|---|

Number of Observations Used | 992 |

Analysis of Variance | |||||

Source | DF | Sum of Squares | Mean Square | F Value | Pr > F |

Model | 23 | 381.081 | 16.56874 | 21.28 | <.0001 |

Error | 968 | 753.8316 | 0.77875 | ||

Corrected Total | 991 | 1134.913 |

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-15-2015 01:16 PM

Since your variable mhi_ctg does not appear as a model variable in the first code then those records were not filtered out. When you add it in the second then you are excluding records that have non-missing values for all of the model variables, looks like about 200 of them. I would expect to get different results with about one-fifth of the records excluded.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-15-2015 01:27 PM

Sorry for the confusion. mhi_grp1-4 were derived from mhi_ctg as mutually exclusive dummy variables. As mhi_grp2-4 were included in both regressions, I believe that they were supposed to run the same data set. Thanks.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-15-2015 01:56 PM

I figured out what the problem was. After I recoded mhi_ctg into four dummy variables mhi_grp1-4, mhi_grp1 was excluded from the regression, and thus the observations with missing values in mhi_grp1 were treated the same way as the ones taking 1 in the variable.

Thank you, Ballard and Paige!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-15-2015 11:28 AM

I was wondering whether it was because SAS applied imputation when running regression.

SAS does not impute missing values in regression. It does not include observations with missing values among the model terms in the regression calculations.