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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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