250.CRIMINAL ACTIVITY ANALYSIS OF DIFFERENT TYPES OF THIEVES IN INDIA (1950–2025) USING PROC PRINT | PROC SORT | PROC MEANS | PROC FREQ | PROC SQL | MACROS IN SAS
CRIMINAL ACTIVITY ANALYSIS OF DIFFERENT TYPES OF THIEVES IN INDIA (1950–2025) USING PROC PRINT | PROC SORT | PROC MEANS | PROC FREQ | PROC SQL | MACROS IN SAS
/*Creating a different types of thieves reported across India between 1950 and 2025*/
Step 1: Creating the Dataset
data thieves_india;
infile datalines dsd dlm=' ' truncover;
length Thief_Type $20 Region $15 Method_Used $25 Arrested_By $20
Items_Stolen $30 Crime_Level $10;
input Thief_ID
Thief_Type :$20.
Region :$15.
Year_Caught
Method_Used :$25.
Arrested_By :$20.
Items_Stolen :$30.
Estimated_Loss
Crime_Level :$10.;
datalines;
1 Pickpocket South 1952 "Sneaky Hand" Police "Wallets, Watches" 2000 Minor
2 Highway_Robber North 1963 "Hold at Gunpoint" Army "Cash, Jewelry" 15000 Major
3 Cyber_Thief West 2022 "Phishing Email" Cyber_Crime "Bank Info" 500000 Major
4 Cat_Burglar East 1975 "Rope Climb" Police "Jewels" 12000 Medium
5 Con_Artist Central 1985 "Fake Identity" CID "Cash, Docs" 30000 Medium
6 Temple_Thief South 1993 "Night Break-in" Police "Idols, Donation Box" 70000 Major
7 Political_Thief North 2001 "Fund Misuse" CBI "Public Money" 5000000 Major
8 Corporate_Thief West 2018 "Data Theft" IT_Cell "Trade Secrets" 2000000 Major
9 Bank_Robber East 1970 "Gunpoint Entry" Police "Cash" 250000 Major
10 Smuggler South 1960 "Border Transport" BSF "Gold, Silver" 400000 Major
11 Art_Thief North 1999 "Forgery & Theft" Police "Paintings" 1000000 Major
12 Shoplifter West 2005 "Disguise Method" Local_Police "Electronics" 5000 Minor
13 Gang_Leader East 2011 "Armed Loot" Crime_Branch "Weapons" 800000 Major
14 Serial_Thief Central 1990 "Same Method" Police "Cash, Gold" 45000 Medium
15 Vehicle_Thief South 1987 "Lock Pick" Police "Cars, Bikes" 200000 Medium
16 Train_Thief North 1958 "Moving Robbery" RPF "Luggage, Cash" 10000 Minor
17 Kidnap_Thief West 1973 "Ransom-Based" ATS "Children" 3000000 Major
18 Fraud_Investor East 2023 "Ponzi Scheme" SEBI "Investor Money" 10000000 Major
19 Insider_Thief Central 2015 "Employee Leak" Vigilance "Company Assets" 750000 Major
20 ATM_Hacker South 2017 "Skimming Devices" Cyber_Crime "ATM Cards" 850000 Major
21 Social_Engineer North 2021 "Fake Calls" Cyber_Crime "OTP, Access" 300000 Medium
22 Relic_Thief West 1965 "Antique Loot" Police "Sculptures" 150000 Medium
23 Drug_Courier East 2008 "Hidden Packets" Narcotics "Drugs" 1000000 Major
24 Identity_Thief Central 2019 "Fake PAN/Aadhaar" Cyber_Crime "Identity Docs" 250000 Medium
25 Fake_Saint South 1995 "Blind Belief Scam" CID "Donations, Land" 600000 Major
26 Petrol_Thief North 2010 "Pump Tampering" Local_Police "Fuel" 120000 Medium
27 Forest_Looter East 1982 "Illegal Logging" Forest_Dept "Timber" 350000 Medium
28 Wildlife_Smuggler Central 2003 "Hidden Crates" Forest_Dept "Animals, Skins" 900000 Major
29 Foodgrain_Thief West 1979 "Storage Fraud" Local_Agents "Ration" 100000 Medium
30 Passport_Scammer North 2024 "Fake Visas" Immigration "Passports" 400000 Major
;
run;
proc print data=thieves_india;
run;
Output:
| Obs | Thief_Type | Region | Method_Used | Arrested_By | Items_Stolen | Crime_Level | Thief_ID | Year_Caught | Estimated_Loss |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Pickpocket | South | Sneaky Hand | Police | Wallets, Watches | Minor | 1 | 1952 | 2000 |
| 2 | Highway_Robber | North | Hold at Gunpoint | Army | Cash, Jewelry | Major | 2 | 1963 | 15000 |
| 3 | Cyber_Thief | West | Phishing Email | Cyber_Crime | Bank Info | Major | 3 | 2022 | 500000 |
| 4 | Cat_Burglar | East | Rope Climb | Police | Jewels | Medium | 4 | 1975 | 12000 |
| 5 | Con_Artist | Central | Fake Identity | CID | Cash, Docs | Medium | 5 | 1985 | 30000 |
| 6 | Temple_Thief | South | Night Break-in | Police | Idols, Donation Box | Major | 6 | 1993 | 70000 |
| 7 | Political_Thief | North | Fund Misuse | CBI | Public Money | Major | 7 | 2001 | 5000000 |
| 8 | Corporate_Thief | West | Data Theft | IT_Cell | Trade Secrets | Major | 8 | 2018 | 2000000 |
| 9 | Bank_Robber | East | Gunpoint Entry | Police | Cash | Major | 9 | 1970 | 250000 |
| 10 | Smuggler | South | Border Transport | BSF | Gold, Silver | Major | 10 | 1960 | 400000 |
| 11 | Art_Thief | North | Forgery & Theft | Police | Paintings | Major | 11 | 1999 | 1000000 |
| 12 | Shoplifter | West | Disguise Method | Local_Police | Electronics | Minor | 12 | 2005 | 5000 |
| 13 | Gang_Leader | East | Armed Loot | Crime_Branch | Weapons | Major | 13 | 2011 | 800000 |
| 14 | Serial_Thief | Central | Same Method | Police | Cash, Gold | Medium | 14 | 1990 | 45000 |
| 15 | Vehicle_Thief | South | Lock Pick | Police | Cars, Bikes | Medium | 15 | 1987 | 200000 |
| 16 | Train_Thief | North | Moving Robbery | RPF | Luggage, Cash | Minor | 16 | 1958 | 10000 |
| 17 | Kidnap_Thief | West | Ransom-Based | ATS | Children | Major | 17 | 1973 | 3000000 |
| 18 | Fraud_Investor | East | Ponzi Scheme | SEBI | Investor Money | Major | 18 | 2023 | 10000000 |
| 19 | Insider_Thief | Central | Employee Leak | Vigilance | Company Assets | Major | 19 | 2015 | 750000 |
| 20 | ATM_Hacker | South | Skimming Devices | Cyber_Crime | ATM Cards | Major | 20 | 2017 | 850000 |
| 21 | Social_Engineer | North | Fake Calls | Cyber_Crime | OTP, Access | Medium | 21 | 2021 | 300000 |
| 22 | Relic_Thief | West | Antique Loot | Police | Sculptures | Medium | 22 | 1965 | 150000 |
| 23 | Drug_Courier | East | Hidden Packets | Narcotics | Drugs | Major | 23 | 2008 | 1000000 |
| 24 | Identity_Thief | Central | Fake PAN/Aadhaar | Cyber_Crime | Identity Docs | Medium | 24 | 2019 | 250000 |
| 25 | Fake_Saint | South | Blind Belief Scam | CID | Donations, Land | Major | 25 | 1995 | 600000 |
| 26 | Petrol_Thief | North | Pump Tampering | Local_Police | Fuel | Medium | 26 | 2010 | 120000 |
| 27 | Forest_Looter | East | Illegal Logging | Forest_Dept | Timber | Medium | 27 | 1982 | 350000 |
| 28 | Wildlife_Smuggler | Central | Hidden Crates | Forest_Dept | Animals, Skins | Major | 28 | 2003 | 900000 |
| 29 | Foodgrain_Thief | West | Storage Fraud | Local_Agents | Ration | Medium | 29 | 1979 | 100000 |
| 30 | Passport_Scammer | North | Fake Visas | Immigration | Passports | Major | 30 | 2024 | 400000 |
Step 2: PROC PRINT — View the Dataset
proc print data=thieves_india;
title "Complete Thief Dataset from 1950 to 2025";
run;
Output:
| Obs | Thief_Type | Region | Method_Used | Arrested_By | Items_Stolen | Crime_Level | Thief_ID | Year_Caught | Estimated_Loss |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Pickpocket | South | Sneaky Hand | Police | Wallets, Watches | Minor | 1 | 1952 | 2000 |
| 2 | Highway_Robber | North | Hold at Gunpoint | Army | Cash, Jewelry | Major | 2 | 1963 | 15000 |
| 3 | Cyber_Thief | West | Phishing Email | Cyber_Crime | Bank Info | Major | 3 | 2022 | 500000 |
| 4 | Cat_Burglar | East | Rope Climb | Police | Jewels | Medium | 4 | 1975 | 12000 |
| 5 | Con_Artist | Central | Fake Identity | CID | Cash, Docs | Medium | 5 | 1985 | 30000 |
| 6 | Temple_Thief | South | Night Break-in | Police | Idols, Donation Box | Major | 6 | 1993 | 70000 |
| 7 | Political_Thief | North | Fund Misuse | CBI | Public Money | Major | 7 | 2001 | 5000000 |
| 8 | Corporate_Thief | West | Data Theft | IT_Cell | Trade Secrets | Major | 8 | 2018 | 2000000 |
| 9 | Bank_Robber | East | Gunpoint Entry | Police | Cash | Major | 9 | 1970 | 250000 |
| 10 | Smuggler | South | Border Transport | BSF | Gold, Silver | Major | 10 | 1960 | 400000 |
| 11 | Art_Thief | North | Forgery & Theft | Police | Paintings | Major | 11 | 1999 | 1000000 |
| 12 | Shoplifter | West | Disguise Method | Local_Police | Electronics | Minor | 12 | 2005 | 5000 |
| 13 | Gang_Leader | East | Armed Loot | Crime_Branch | Weapons | Major | 13 | 2011 | 800000 |
| 14 | Serial_Thief | Central | Same Method | Police | Cash, Gold | Medium | 14 | 1990 | 45000 |
| 15 | Vehicle_Thief | South | Lock Pick | Police | Cars, Bikes | Medium | 15 | 1987 | 200000 |
| 16 | Train_Thief | North | Moving Robbery | RPF | Luggage, Cash | Minor | 16 | 1958 | 10000 |
| 17 | Kidnap_Thief | West | Ransom-Based | ATS | Children | Major | 17 | 1973 | 3000000 |
| 18 | Fraud_Investor | East | Ponzi Scheme | SEBI | Investor Money | Major | 18 | 2023 | 10000000 |
| 19 | Insider_Thief | Central | Employee Leak | Vigilance | Company Assets | Major | 19 | 2015 | 750000 |
| 20 | ATM_Hacker | South | Skimming Devices | Cyber_Crime | ATM Cards | Major | 20 | 2017 | 850000 |
| 21 | Social_Engineer | North | Fake Calls | Cyber_Crime | OTP, Access | Medium | 21 | 2021 | 300000 |
| 22 | Relic_Thief | West | Antique Loot | Police | Sculptures | Medium | 22 | 1965 | 150000 |
| 23 | Drug_Courier | East | Hidden Packets | Narcotics | Drugs | Major | 23 | 2008 | 1000000 |
| 24 | Identity_Thief | Central | Fake PAN/Aadhaar | Cyber_Crime | Identity Docs | Medium | 24 | 2019 | 250000 |
| 25 | Fake_Saint | South | Blind Belief Scam | CID | Donations, Land | Major | 25 | 1995 | 600000 |
| 26 | Petrol_Thief | North | Pump Tampering | Local_Police | Fuel | Medium | 26 | 2010 | 120000 |
| 27 | Forest_Looter | East | Illegal Logging | Forest_Dept | Timber | Medium | 27 | 1982 | 350000 |
| 28 | Wildlife_Smuggler | Central | Hidden Crates | Forest_Dept | Animals, Skins | Major | 28 | 2003 | 900000 |
| 29 | Foodgrain_Thief | West | Storage Fraud | Local_Agents | Ration | Medium | 29 | 1979 | 100000 |
| 30 | Passport_Scammer | North | Fake Visas | Immigration | Passports | Major | 30 | 2024 | 400000 |
Step 3: PROC SORT — Organizing the Data
proc sort data=thieves_india out=sorted_thieves;
by Region Year_Caught;
run;
proc print data=sorted_thieves;
title "Sorted Thieves by Region and Year Caught";
run;
Output:
| Obs | Thief_Type | Region | Method_Used | Arrested_By | Items_Stolen | Crime_Level | Thief_ID | Year_Caught | Estimated_Loss |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Con_Artist | Central | Fake Identity | CID | Cash, Docs | Medium | 5 | 1985 | 30000 |
| 2 | Serial_Thief | Central | Same Method | Police | Cash, Gold | Medium | 14 | 1990 | 45000 |
| 3 | Wildlife_Smuggler | Central | Hidden Crates | Forest_Dept | Animals, Skins | Major | 28 | 2003 | 900000 |
| 4 | Insider_Thief | Central | Employee Leak | Vigilance | Company Assets | Major | 19 | 2015 | 750000 |
| 5 | Identity_Thief | Central | Fake PAN/Aadhaar | Cyber_Crime | Identity Docs | Medium | 24 | 2019 | 250000 |
| 6 | Bank_Robber | East | Gunpoint Entry | Police | Cash | Major | 9 | 1970 | 250000 |
| 7 | Cat_Burglar | East | Rope Climb | Police | Jewels | Medium | 4 | 1975 | 12000 |
| 8 | Forest_Looter | East | Illegal Logging | Forest_Dept | Timber | Medium | 27 | 1982 | 350000 |
| 9 | Drug_Courier | East | Hidden Packets | Narcotics | Drugs | Major | 23 | 2008 | 1000000 |
| 10 | Gang_Leader | East | Armed Loot | Crime_Branch | Weapons | Major | 13 | 2011 | 800000 |
| 11 | Fraud_Investor | East | Ponzi Scheme | SEBI | Investor Money | Major | 18 | 2023 | 10000000 |
| 12 | Train_Thief | North | Moving Robbery | RPF | Luggage, Cash | Minor | 16 | 1958 | 10000 |
| 13 | Highway_Robber | North | Hold at Gunpoint | Army | Cash, Jewelry | Major | 2 | 1963 | 15000 |
| 14 | Art_Thief | North | Forgery & Theft | Police | Paintings | Major | 11 | 1999 | 1000000 |
| 15 | Political_Thief | North | Fund Misuse | CBI | Public Money | Major | 7 | 2001 | 5000000 |
| 16 | Petrol_Thief | North | Pump Tampering | Local_Police | Fuel | Medium | 26 | 2010 | 120000 |
| 17 | Social_Engineer | North | Fake Calls | Cyber_Crime | OTP, Access | Medium | 21 | 2021 | 300000 |
| 18 | Passport_Scammer | North | Fake Visas | Immigration | Passports | Major | 30 | 2024 | 400000 |
| 19 | Pickpocket | South | Sneaky Hand | Police | Wallets, Watches | Minor | 1 | 1952 | 2000 |
| 20 | Smuggler | South | Border Transport | BSF | Gold, Silver | Major | 10 | 1960 | 400000 |
| 21 | Vehicle_Thief | South | Lock Pick | Police | Cars, Bikes | Medium | 15 | 1987 | 200000 |
| 22 | Temple_Thief | South | Night Break-in | Police | Idols, Donation Box | Major | 6 | 1993 | 70000 |
| 23 | Fake_Saint | South | Blind Belief Scam | CID | Donations, Land | Major | 25 | 1995 | 600000 |
| 24 | ATM_Hacker | South | Skimming Devices | Cyber_Crime | ATM Cards | Major | 20 | 2017 | 850000 |
| 25 | Relic_Thief | West | Antique Loot | Police | Sculptures | Medium | 22 | 1965 | 150000 |
| 26 | Kidnap_Thief | West | Ransom-Based | ATS | Children | Major | 17 | 1973 | 3000000 |
| 27 | Foodgrain_Thief | West | Storage Fraud | Local_Agents | Ration | Medium | 29 | 1979 | 100000 |
| 28 | Shoplifter | West | Disguise Method | Local_Police | Electronics | Minor | 12 | 2005 | 5000 |
| 29 | Corporate_Thief | West | Data Theft | IT_Cell | Trade Secrets | Major | 8 | 2018 | 2000000 |
| 30 | Cyber_Thief | West | Phishing Email | Cyber_Crime | Bank Info | Major | 3 | 2022 | 500000 |
Step 4: PROC FREQ — Frequency Analysis
Frequency of Thief Types:
proc freq data=thieves_india;
tables Thief_Type;
title "Frequency of Different Thief Types";
run;
Output:
The FREQ Procedure
| Thief_Type | Frequency | Percent | Cumulative Frequency | Cumulative Percent |
|---|---|---|---|---|
| ATM_Hacker | 1 | 3.33 | 1 | 3.33 |
| Art_Thief | 1 | 3.33 | 2 | 6.67 |
| Bank_Robber | 1 | 3.33 | 3 | 10.00 |
| Cat_Burglar | 1 | 3.33 | 4 | 13.33 |
| Con_Artist | 1 | 3.33 | 5 | 16.67 |
| Corporate_Thief | 1 | 3.33 | 6 | 20.00 |
| Cyber_Thief | 1 | 3.33 | 7 | 23.33 |
| Drug_Courier | 1 | 3.33 | 8 | 26.67 |
| Fake_Saint | 1 | 3.33 | 9 | 30.00 |
| Foodgrain_Thief | 1 | 3.33 | 10 | 33.33 |
| Forest_Looter | 1 | 3.33 | 11 | 36.67 |
| Fraud_Investor | 1 | 3.33 | 12 | 40.00 |
| Gang_Leader | 1 | 3.33 | 13 | 43.33 |
| Highway_Robber | 1 | 3.33 | 14 | 46.67 |
| Identity_Thief | 1 | 3.33 | 15 | 50.00 |
| Insider_Thief | 1 | 3.33 | 16 | 53.33 |
| Kidnap_Thief | 1 | 3.33 | 17 | 56.67 |
| Passport_Scammer | 1 | 3.33 | 18 | 60.00 |
| Petrol_Thief | 1 | 3.33 | 19 | 63.33 |
| Pickpocket | 1 | 3.33 | 20 | 66.67 |
| Political_Thief | 1 | 3.33 | 21 | 70.00 |
| Relic_Thief | 1 | 3.33 | 22 | 73.33 |
| Serial_Thief | 1 | 3.33 | 23 | 76.67 |
| Shoplifter | 1 | 3.33 | 24 | 80.00 |
| Smuggler | 1 | 3.33 | 25 | 83.33 |
| Social_Engineer | 1 | 3.33 | 26 | 86.67 |
| Temple_Thief | 1 | 3.33 | 27 | 90.00 |
| Train_Thief | 1 | 3.33 | 28 | 93.33 |
| Vehicle_Thief | 1 | 3.33 | 29 | 96.67 |
| Wildlife_Smuggler | 1 | 3.33 | 30 | 100.00 |
Frequency by Region:
proc freq data=thieves_india;
tables Region;
title "Thief Cases by Region";
run;
Output:
The FREQ Procedure
| Region | Frequency | Percent | Cumulative Frequency | Cumulative Percent |
|---|---|---|---|---|
| Central | 5 | 16.67 | 5 | 16.67 |
| East | 6 | 20.00 | 11 | 36.67 |
| North | 7 | 23.33 | 18 | 60.00 |
| South | 6 | 20.00 | 24 | 80.00 |
| West | 6 | 20.00 | 30 | 100.00 |
Crime Level Distribution:
proc freq data=thieves_india;
tables Crime_Level / nocum;
title "Distribution of Crime Severity";
run;
Output:
The FREQ Procedure
| Crime_Level | Frequency | Percent |
|---|---|---|
| Major | 17 | 56.67 |
| Medium | 10 | 33.33 |
| Minor | 3 | 10.00 |
Step 5: PROC MEANS — Estimated Loss Analysis
proc means data=thieves_india mean sum maxdec=0;
var Estimated_Loss;
class Crime_Level;
title "Summary of Losses by Crime Level";
run;
Output:
The MEANS Procedure
| Analysis Variable : Estimated_Loss | |||
|---|---|---|---|
| Crime_Level | N Obs | Mean | Sum |
| Major | 17 | 1619706 | 27535000 |
| Medium | 10 | 155700 | 1557000 |
| Minor | 3 | 5667 | 17000 |
Step 6: PROC SQL — Advanced Data Analysis
Top 5 Highest Loss Thefts:
proc sql outobs=5;
title "Top 5 High Loss Thefts";
select Thief_Type, Region, Estimated_Loss
from thieves_india
order by Estimated_Loss desc;
quit;
Output:
| Thief_Type | Region | Estimated_Loss |
|---|---|---|
| Fraud_Investor | East | 10000000 |
| Political_Thief | North | 5000000 |
| Kidnap_Thief | West | 3000000 |
| Corporate_Thief | West | 2000000 |
| Art_Thief | North | 1000000 |
Average Loss by Region:
proc sql;
title "Average Loss by Region";
select Region, avg(Estimated_Loss) as Avg_Loss format=comma12.
from thieves_india
group by Region;
quit;
Output:
| Region | Avg_Loss |
|---|---|
| Central | 395,000 |
| East | 2,068,667 |
| North | 977,857 |
| South | 353,667 |
| West | 959,167 |
Thieves Caught After 2000:
proc sql;
title "Thieves Caught After 2000";
select Thief_Type, Year_Caught, Crime_Level
from thieves_india
where Year_Caught > 2000;
quit;
Output:
| Thief_Type | Year_Caught | Crime_Level |
|---|---|---|
| Cyber_Thief | 2022 | Major |
| Political_Thief | 2001 | Major |
| Corporate_Thief | 2018 | Major |
| Shoplifter | 2005 | Minor |
| Gang_Leader | 2011 | Major |
| Fraud_Investor | 2023 | Major |
| Insider_Thief | 2015 | Major |
| ATM_Hacker | 2017 | Major |
| Social_Engineer | 2021 | Medium |
| Drug_Courier | 2008 | Major |
| Identity_Thief | 2019 | Medium |
| Petrol_Thief | 2010 | Medium |
| Wildlife_Smuggler | 2003 | Major |
| Passport_Scammer | 2024 | Major |
Step 7: Creating a Macro — Crime Summary by Region
%macro crime_by_region(region_name);
proc sql;
title "Crimes in ®ion_name Region";
select Thief_Type, Year_Caught, Method_Used, Estimated_Loss, Crime_Level
from thieves_india
where Region = "®ion_name";
quit;
%mend;
%crime_by_region(North);
Output:
| Thief_Type | Year_Caught | Method_Used | Estimated_Loss | Crime_Level |
|---|---|---|---|---|
| Highway_Robber | 1963 | Hold at Gunpoint | 15000 | Major |
| Political_Thief | 2001 | Fund Misuse | 5000000 | Major |
| Art_Thief | 1999 | Forgery & Theft | 1000000 | Major |
| Train_Thief | 1958 | Moving Robbery | 10000 | Minor |
| Social_Engineer | 2021 | Fake Calls | 300000 | Medium |
| Petrol_Thief | 2010 | Pump Tampering | 120000 | Medium |
| Passport_Scammer | 2024 | Fake Visas | 400000 | Major |
%crime_by_region(South);
Output:
| Thief_Type | Year_Caught | Method_Used | Estimated_Loss | Crime_Level |
|---|---|---|---|---|
| Pickpocket | 1952 | Sneaky Hand | 2000 | Minor |
| Temple_Thief | 1993 | Night Break-in | 70000 | Major |
| Smuggler | 1960 | Border Transport | 400000 | Major |
| Vehicle_Thief | 1987 | Lock Pick | 200000 | Medium |
| ATM_Hacker | 2017 | Skimming Devices | 850000 | Major |
| Fake_Saint | 1995 | Blind Belief Scam | 600000 | Major |
%crime_by_region(West);
Output:
| Thief_Type | Year_Caught | Method_Used | Estimated_Loss | Crime_Level |
|---|---|---|---|---|
| Cyber_Thief | 2022 | Phishing Email | 500000 | Major |
| Corporate_Thief | 2018 | Data Theft | 2000000 | Major |
| Shoplifter | 2005 | Disguise Method | 5000 | Minor |
| Kidnap_Thief | 1973 | Ransom-Based | 3000000 | Major |
| Relic_Thief | 1965 | Antique Loot | 150000 | Medium |
| Foodgrain_Thief | 1979 | Storage Fraud | 100000 | Medium |
%crime_by_region(East);
Output:
| Thief_Type | Year_Caught | Method_Used | Estimated_Loss | Crime_Level |
|---|---|---|---|---|
| Cat_Burglar | 1975 | Rope Climb | 12000 | Medium |
| Bank_Robber | 1970 | Gunpoint Entry | 250000 | Major |
| Gang_Leader | 2011 | Armed Loot | 800000 | Major |
| Fraud_Investor | 2023 | Ponzi Scheme | 10000000 | Major |
| Drug_Courier | 2008 | Hidden Packets | 1000000 | Major |
| Forest_Looter | 1982 | Illegal Logging | 350000 | Medium |
%crime_by_region(Central);
Output:
| Thief_Type | Year_Caught | Method_Used | Estimated_Loss | Crime_Level |
|---|---|---|---|---|
| Con_Artist | 1985 | Fake Identity | 30000 | Medium |
| Serial_Thief | 1990 | Same Method | 45000 | Medium |
| Insider_Thief | 2015 | Employee Leak | 750000 | Major |
| Identity_Thief | 2019 | Fake PAN/Aadhaar | 250000 | Medium |
| Wildlife_Smuggler | 2003 | Hidden Crates | 900000 | Major |
Step 8: Additional Macro — Count by Crime Level
%macro count_by_level(level);
proc sql;
title "Total Thieves by &level Crime Level";
select count(*) as Total_Thieves, sum(Estimated_Loss) as Total_Loss format=comma12.
from thieves_india
where Crime_Level = "&level";
quit;
%mend;
%count_by_level(Minor);
Output:
| Total_Thieves | Total_Loss |
|---|---|
| 3 | 17,000 |
%count_by_level(Medium);
Output:
| Total_Thieves | Total_Loss |
|---|---|
| 10 | 1,557,000 |
%count_by_level(Major);
Output:
| Total_Thieves | Total_Loss |
|---|---|
| 17 | 27,535,000 |
Step 9: Custom Report — Loss Over Time
proc sql;
title "Total Estimated Loss by Decade";
select floor(Year_Caught/10)*10 as Decade,
sum(Estimated_Loss) as Total_Loss format=comma12.
from thieves_india
group by calculated Decade
order by Decade;
quit;
Output:
| Decade | Total_Loss |
|---|---|
| 1950 | 12,000 |
| 1960 | 565,000 |
| 1970 | 3,362,000 |
| 1980 | 580,000 |
| 1990 | 1,715,000 |
| 2000 | 6,905,000 |
| 2010 | 4,770,000 |
| 2020 | 11,200,000 |
Comments
Post a Comment