hi, thank you in advance for your kind attention.
i have 2 variables: COMPANYID and YEAR
COMPANYID is between 1-100. YEAR can be anywhere between 1950-2013
I want to keep the COMPANYIDs that have more than 10 years within them.
for example:
companyID 1 may have year 1950, 1951 only. i want to drop companyID 1 completely because i only see 2 years and my threshold is 10.
Can you provide me your guidance?
thank you!
Do the years need to be consecutive, or do any 10 years count?
proc sql;
create table want as
select companyid, year, count(*) as count_years
from have
group by companyid
having count(year)>10;
quit;
Do the years need to be consecutive, or do any 10 years count?
proc sql;
create table want as
select companyid, year, count(*) as count_years
from have
group by companyid
having count(year)>10;
quit;
thank you for your reply reeza.
what if i want them to fall in a specific time period? ie: 1950-1960? thank you much!
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.
Ready to level-up your skills? Choose your own adventure.