BookmarkSubscribeRSS Feed
Roy
Calcite | Level 5 Roy
Calcite | Level 5

Hi guys,

First of all my apologies if this question is simple, but it was hard to search for similar questions.

I have a dataset like this:

abcountdif
666
191913
323213
919159
10510514
14314338
1441
17217228
19919927
27227242
32632654
35635630

Column count equals either a or b, whichever is not missing; while dif is simply the difference between each observation in count and its lag value. My desired output is this:

abcountdif
666
191913
919159
10510514
17217228
32632654
35635630

This is to say, I want to keep only observations where a is not missing, while keeping dif value as it was. But once I use where a ne .; the new dif adjusts itself automatically (e.g. row 3 becomes 72 rather than 59). Any suggestions would be greatly appreciated.

Cheers

Roy

1 REPLY 1
Roy
Calcite | Level 5 Roy
Calcite | Level 5

Hi guys,

Please ignore this question. I just realised I can put the where statement in a separate procedure to make it work. Thanks.

Roy

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
  • 1 reply
  • 748 views
  • 0 likes
  • 1 in conversation