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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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