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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.