Removing observations

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

Removing observations

Hi I have a data set and would like to remove certain firms:

Firms are identified by the SIC variable.

I would like to remove all firms between 4900-4999 and 6000-6999

How does the following code look?

data  subsample2;
set subsample1;
if SIC between 4900 and 4999 or
6000 and 6999 then delete;

run;


Accepted Solutions
Solution
‎10-09-2013 10:52 PM
Frequent Contributor
Frequent Contributor
Posts: 83

Re: Removing observations


Try this

data  subsample2;

set subsample1;

if 4900 le SIC le 4999  or

6000 le SIC le 6999 then delete;

run;



View solution in original post


All Replies
Solution
‎10-09-2013 10:52 PM
Frequent Contributor
Frequent Contributor
Posts: 83

Re: Removing observations


Try this

data  subsample2;

set subsample1;

if 4900 le SIC le 4999  or

6000 le SIC le 6999 then delete;

run;



Super Contributor
Posts: 1,636

Re: Removing observations

try:

if 4900<=sic<=4999 or 6000<=sic<6999 then delete;

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 455 views
  • 3 likes
  • 3 in conversation