Hi,
If my data looks like follows, how do I drop permnos where (A200801--A200805) contains less than say 4 observations?
permno | A200801 | A200802 | A200803 | A200804 | A200805 | B200801 | B200802 | B200803 | B200804 | B200805 |
1 | ||||||||||
2 | ||||||||||
3 |
If those variables are numeric and you want to delete observations with less than 4 non missing values, then:
if n(of A200801 -- A200805) < 4 then delete;
If those variables are numeric and you want to delete observations with less than 4 non missing values, then:
if n(of A200801 -- A200805) < 4 then delete;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.