BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Huey
Calcite | Level 5


Hi All,

     I have come across a strange situation where a numeric variable is zero in both the base and compare datasets, on the matching ID, and yet they are showing up in the differences output. Below is how I've set up the compare code:

proc compare  base       = work.base_ds

                        compare  = work.compare_ds

                        listobs listvar maxprint=(25,3000) ;

           ID InternalID notsorted;

           attrib       _ALL_ label=''; /*Get rid of labels, formats and informats for comparison.*/

           format     _ALL_ ;

           informat  _ALL_ ;

run;

Below is an example of the results:

_______________________________________________________________

                          ||    Base      Compare                          

  InternalID        ||    Score      Score      Diff.     % Diff      

____________ ||  _________  _________  _________  _________    

                          ||                                                

        8329          ||          0          0          0          0    

        8331          ||          0          0          0          0   

Any ideas?

Thanks,

Huey

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

Format SCORE with the HEX16. format.  You should see a difference perhaps in the last digit.

View solution in original post

4 REPLIES 4
data_null__
Jade | Level 19

Format SCORE with the HEX16. format.  You should see a difference perhaps in the last digit.

ballardw
Super User

Or try the FUZZ= option. They are probably displaying as equal because of the format an may vary by a small amount.

If your data is such that a diference such as 1e-8 is "close enough to equal" try FUZZ= 1E-8 (OR 0.00000001) or other small value.

Differences smaller than your FUZZ value will be considered equal.

Huey
Calcite | Level 5

Thanks for the input ballardw, but the "difference" still shows up when I use your fuzz factor setting, even when I use a very fuzzy factor (0.001) the "difference" still shows. : |

Huey
Calcite | Level 5

This is yielding interesting/aggrevating information. Representing the fields in HEX16. format shows that:

Base        - Score = 0000000000000000

Compare - Score =                0

So, after wondering how on earth one '0' was popping up, I finally realized that I had the MISSING='0' option set!!!

I was comparing a missing value to '0' without knowing it. The HEX format really brought that to life. Thank you.

This option was buried in my process control file, and was hard to locate. Please forgive me for wasting your time!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2336 views
  • 0 likes
  • 3 in conversation