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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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