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;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.