BookmarkSubscribeRSS Feed
dincoo
SAS Employee

Hi everyone,

 

We have a rule that helps to find auto insurarance fraud and I am trying to code it.

 

The rule is: If the same vehicle_id's appear more than one incident.

The sample data is attached.

At the example there are two claims. First of them consists of 3 vehicles, second of them consists of 2 vehicles.

 

 

 

Thank you very much,

Onur

1 REPLY 1
EH
Obsidian | Level 7 EH
Obsidian | Level 7

Hello Onur,

 

I've added one suspect vehicle_id and prepared some code. This may give you a start...

 

data incidents;
   input INCIDENT_ID 1-7 VEHICLE_ORDER_NO 9 VEHICLE_ID $ 11-27;
   datalines;
4704002 1 JHMGD18707S205511 
4704002 2 VF1LAOF0520635569 
4704002 3 VF37ANFZWWP005871 
4704053 1 VF32BKFWA9D002173 
4704053 2 WF0HXXWPDH9C49160
4704053 2 VF1LAOF0520635569 
run;

proc sql;
   create table suspects as
      select vehicle_id, count(distinct incident_id) as nr_incid
        from incidents
    group by 1;

   create table incidents2 as
      select incidents.*, suspects.nr_incid
        from incidents, suspects
      where incidents.vehicle_id = suspects.vehicle_id;
quit;

proc print data=incidents2;
run;

 

 

Hope this helps,

Cheers, Eric

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 547 views
  • 0 likes
  • 2 in conversation