BookmarkSubscribeRSS Feed
Radwan
Quartz | Level 8

Hello 

usually i use nodupkey option to eliminate the replicated observations, but i think this option removes all observations that occur next year and so on.

other words this option keeps only first year-observations while i have ten years observations, so  I need to know how much replicated obs i have in my datafile. 

thanks 

6 REPLIES 6
PeterClemmensen
Tourmaline | Level 20

You can use the DUPOUT= Option in the PROC SORT Statement.

andreas_lds
Jade | Level 19

Please post the code you are using and an excerpt of the data and explain which obs are "accidentally" removed. The "nodupkey" option keeps only the first observation within a group defined by BY-statement.

Radwan
Quartz | Level 8
proc sort data=real_var1 nodupkey; by code year; run;

the observations were 34000 then became 1931 observations 

when i checked the number of firms it was 1931 firms.

while i have data for 9 years.

 

andreas_lds
Jade | Level 19

You should add the year-variable to the by-statement, if you want obs for each year.

Astounding
PROC Star

Check your data.  It's probably messed up.  The result you describe would only be possible if the YEAR values were the same for all observations.  

Radwan
Quartz | Level 8
ok i will
thanks

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
  • 6 replies
  • 1151 views
  • 2 likes
  • 4 in conversation