398.Is Your Favorite Restaurant Really Safe? What Do Food Inspection Scores Reveal?A Sas Data Analytics

Is Your Favorite Restaurant Really Safe? What Do Food Inspection Scores Reveal?A Sas Data Analytics

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

HERE IN THIS PROJECT WE USED THESE SAS STATEMENTS —
DATA STEP | PROC SQL |  PROC PRINT | PROC SGPLOT | MACROS | PROC CORR | PROC MEANS | PROC FREQ | PROC UNIVARIATE | PROC SORT | MERGE | PROC TRANSPOSE | PROC DATASETS DELETE | DATA FUNCTIONS

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

INTRODUCTION

Food safety inspections play a critical role in public health.
Government bodies inspect restaurants periodically to ensure hygiene, safety, and regulatory compliance.
Poor food safety leads to:

  • Food poisoning outbreaks
  • Loss of public trust
  • Legal penalties
  • Business shutdowns

This SAS project simulates realistic food safety inspection data and demonstrates how a SAS Programmer analyzes, validates, classifies, and detects risk or fraud patterns using:

  • DATA step
  • PROC SQL
  • PROC MEANS
  • PROC UNIVARIATE
  • PROC FREQ
  • PROC CORR
  • PROC SGPLOT
  • MACROS
  • DATE FUNCTIONS (MDY, INTCK, INTNX)
  • STRING FUNCTIONS (STRIP, TRIM, CAT, CATX, PROPCASE, UPCASE, LOWCASE)
  • DATA MANAGEMENT (SET, MERGE, APPEND, TRANSPOSE)
  • PROC DATASETS DELETE

 TABLE OF CONTENTS

  1. Business Context
  2. Dataset Design
  3. Raw Data Creation
  4. Data Cleaning & Formatting
  5. Date Derivations
  6. Utilization Classification (Macro)
  7. Compliance Percentage Calculation
  8. Fraud Detection Logic (Macro)
  9. PROC SQL Analysis
  10. PROC FREQ Analysis
  11. PROC MEANS Analysis
  12. PROC UNIVARIATE Analysis
  13. PROC CORR Analysis
  14. Visualization using PROC SGPLOT
  15. Data Restructuring (TRANSPOSE, MERGE)
  16. Dataset Maintenance (PROC DATASETS DELETE)
  17. Business Insights
  18. Conclusion

1.1. BUSINESS CONTEXT

Stakeholders:

  • Municipal food safety departments
  • Restaurant owners
  • Public health analysts
  • Policy makers

Business Questions Answered:

  • Which cities have poor compliance?
  • Are inspections happening frequently enough?
  • Which restaurants show suspicious patterns?
  • Is re-inspection delayed for unsafe restaurants?
  • Is hygiene correlated with inspection score?

2.2.DATASET DESIGN

Core Variables

Variable

Description

Restaurant_ID

Unique restaurant identifier

City

Inspection city

Inspection_Date

Date of inspection

Inspection_Score

Score out of 100

Violations_Count

Number of violations

Reinspection_Days

Days until next inspection

Hygiene_Level

High / Medium / Low

Compliance_Status

Compliant / Non-Compliant

Compliance_Percentage

Calculated percentage

Inspector_Name

Inspector

Risk_Flag

Fraud/Risk indicator


3. RAW DATA CREATION

data food_inspection_raw;

    length Restaurant_ID $6 City $15 Hygiene_Level $10 Inspector_Name $20;

    input Restaurant_ID $ City $ Inspection_Date : date9. Inspection_Score Violations_Count

          Reinspection_Days Hygiene_Level $ Inspector_Name $;

    format Inspection_Date date9.;

    datalines;

R001 hyderabad 01JAN2025 92 1 30 High ramesh

R002 mumbai    05JAN2025 68 5 10 Low  suresh

R003 delhi     07JAN2025 75 3 20 Medium anil

R004 chennai   10JAN2025 88 2 25 High kavita

R005 kolkata   12JAN2025 55 7 7  Low  ramesh

R006 pune      15JAN2025 81 2 30 Medium anil

R007 hyderabad 18JAN2025 60 6 14 Low  suresh

R008 mumbai    20JAN2025 90 1 30 High kavita

R009 delhi     22JAN2025 72 4 15 Medium ramesh

R010 chennai   25JAN2025 85 2 28 High anil

R011 kolkata   27JAN2025 58 8 5  Low  suresh

R012 pune      28JAN2025 79 3 20 Medium kavita

R013 hyderabad 30JAN2025 95 0 45 High ramesh

R014 mumbai    01FEB2025 62 6 12 Low  anil

R015 delhi     03FEB2025 70 4 18 Medium kavita

R016 chennai   05FEB2025 82 2 30 High suresh

;

run;

proc print data=food_inspection_raw;

run;

OUTPUT:

ObsRestaurant_IDCityHygiene_LevelInspector_NameInspection_DateInspection_ScoreViolations_CountReinspection_Days
1R001hyderabadHighramesh01JAN202592130
2R002mumbaiLowsuresh05JAN202568510
3R003delhiMediumanil07JAN202575320
4R004chennaiHighkavita10JAN202588225
5R005kolkataLowramesh12JAN20255577
6R006puneMediumanil15JAN202581230
7R007hyderabadLowsuresh18JAN202560614
8R008mumbaiHighkavita20JAN202590130
9R009delhiMediumramesh22JAN202572415
10R010chennaiHighanil25JAN202585228
11R011kolkataLowsuresh27JAN20255885
12R012puneMediumkavita28JAN202579320
13R013hyderabadHighramesh30JAN202595045
14R014mumbaiLowanil01FEB202562612
15R015delhiMediumkavita03FEB202570418
16R016chennaiHighsuresh05FEB202582230

·  LENGTH avoids truncation

·  DATE9. ensures proper date handling

·  Realistic inspection patterns

·  Mixed hygiene levels & scores

4. DATA CLEANING & STANDARDIZATION

data food_inspection_clean;

    set food_inspection_raw;

    City = propcase(strip(City));

    Hygiene_Level = upcase(strip(Hygiene_Level));

    Inspector_Name = propcase(strip(Inspector_Name));

    length Compliance_Status $15;

    if Inspection_Score >= 80 then Compliance_Status = "Compliant";

    else Compliance_Status = "Non-Compliant";

run;

proc print data=food_inspection_clean;

 var Restaurant_ID City Hygiene_Level Inspector_Name Inspection_Score Compliance_Status;

run;

OUTPUT:

ObsRestaurant_IDCityHygiene_LevelInspector_NameInspection_ScoreCompliance_Status
1R001HyderabadHIGHRamesh92Compliant
2R002MumbaiLOWSuresh68Non-Compliant
3R003DelhiMEDIUMAnil75Non-Compliant
4R004ChennaiHIGHKavita88Compliant
5R005KolkataLOWRamesh55Non-Compliant
6R006PuneMEDIUMAnil81Compliant
7R007HyderabadLOWSuresh60Non-Compliant
8R008MumbaiHIGHKavita90Compliant
9R009DelhiMEDIUMRamesh72Non-Compliant
10R010ChennaiHIGHAnil85Compliant
11R011KolkataLOWSuresh58Non-Compliant
12R012PuneMEDIUMKavita79Non-Compliant
13R013HyderabadHIGHRamesh95Compliant
14R014MumbaiLOWAnil62Non-Compliant
15R015DelhiMEDIUMKavita70Non-Compliant
16R016ChennaiHIGHSuresh82Compliant

·  STRIP/TRIM: removes unwanted spaces

·  PROPCASE: professional city names

·  UPCASE: standard categorical values

·  Rule-based compliance logic 

5. DATE DERIVATIONS (MDY, INTCK, INTNX)

data food_inspection_dates;

    set food_inspection_clean;

    Inspection_Month = intnx('month', Inspection_Date, 0, 'b');

    Days_Since_Inspection = intck('day', Inspection_Date, today());

    Next_Inspection_Date = intnx('day', Inspection_Date, Reinspection_Days);

run;

proc print data=food_inspection_dates;

 var Restaurant_ID City Hygiene_Level Inspector_Name Inspection_Date Inspection_Month

     Days_Since_Inspection Next_Inspection_Date Reinspection_Days;

run;

OUTPUT:

ObsRestaurant_IDCityHygiene_LevelInspector_NameInspection_DateInspection_MonthDays_Since_InspectionNext_Inspection_DateReinspection_Days
1R001HyderabadHIGHRamesh01JAN2025237424062377230
2R002MumbaiLOWSuresh05JAN2025237424022375610
3R003DelhiMEDIUMAnil07JAN2025237424002376820
4R004ChennaiHIGHKavita10JAN2025237423972377625
5R005KolkataLOWRamesh12JAN202523742395237607
6R006PuneMEDIUMAnil15JAN2025237423922378630
7R007HyderabadLOWSuresh18JAN2025237423892377314
8R008MumbaiHIGHKavita20JAN2025237423872379130
9R009DelhiMEDIUMRamesh22JAN2025237423852377815
10R010ChennaiHIGHAnil25JAN2025237423822379428
11R011KolkataLOWSuresh27JAN202523742380237735
12R012PuneMEDIUMKavita28JAN2025237423792378920
13R013HyderabadHIGHRamesh30JAN2025237423772381645
14R014MumbaiLOWAnil01FEB2025237733752378512
15R015DelhiMEDIUMKavita03FEB2025237733732379318
16R016ChennaiHIGHSuresh05FEB2025237733712380730

·  Identify overdue inspections

·  Schedule future audits

·  Regulatory planning

6. COMPLIANCE PERCENTAGE

data food_inspection_pct;

    set food_inspection_dates;

    Compliance_Percentage = round((Inspection_Score / 100) * 100, 0.01);

run;

proc print data=food_inspection_pct;

 var Restaurant_ID City Hygiene_Level Inspector_Name Inspection_Score Compliance_Percentage;

run;

OUTPUT:

ObsRestaurant_IDCityHygiene_LevelInspector_NameInspection_ScoreCompliance_Percentage
1R001HyderabadHIGHRamesh9292
2R002MumbaiLOWSuresh6868
3R003DelhiMEDIUMAnil7575
4R004ChennaiHIGHKavita8888
5R005KolkataLOWRamesh5555
6R006PuneMEDIUMAnil8181
7R007HyderabadLOWSuresh6060
8R008MumbaiHIGHKavita9090
9R009DelhiMEDIUMRamesh7272
10R010ChennaiHIGHAnil8585
11R011KolkataLOWSuresh5858
12R012PuneMEDIUMKavita7979
13R013HyderabadHIGHRamesh9595
14R014MumbaiLOWAnil6262
15R015DelhiMEDIUMKavita7070
16R016ChennaiHIGHSuresh8282

7. UTILIZATION CLASSIFICATION (MACRO)

%macro classify_utilization;

data food_inspection_util;

    set food_inspection_pct;

    length Utilization_Level $12.;

    if Reinspection_Days <= 10 then Utilization_Level = "High Risk";

    else if Reinspection_Days <= 25 then Utilization_Level = "Medium Risk";

    else Utilization_Level = "Low Risk";

run;

proc print data=food_inspection_util;

run;

%mend;


%classify_utilization;

OUTPUT:

ObsRestaurant_IDCityHygiene_LevelInspector_NameInspection_DateInspection_ScoreViolations_CountReinspection_DaysCompliance_StatusInspection_MonthDays_Since_InspectionNext_Inspection_DateCompliance_PercentageUtilization_Level
1R001HyderabadHIGHRamesh01JAN202592130Compliant237424062377292Low Risk
2R002MumbaiLOWSuresh05JAN202568510Non-Compliant237424022375668High Risk
3R003DelhiMEDIUMAnil07JAN202575320Non-Compliant237424002376875Medium Risk
4R004ChennaiHIGHKavita10JAN202588225Compliant237423972377688Medium Risk
5R005KolkataLOWRamesh12JAN20255577Non-Compliant237423952376055High Risk
6R006PuneMEDIUMAnil15JAN202581230Compliant237423922378681Low Risk
7R007HyderabadLOWSuresh18JAN202560614Non-Compliant237423892377360Medium Risk
8R008MumbaiHIGHKavita20JAN202590130Compliant237423872379190Low Risk
9R009DelhiMEDIUMRamesh22JAN202572415Non-Compliant237423852377872Medium Risk
10R010ChennaiHIGHAnil25JAN202585228Compliant237423822379485Low Risk
11R011KolkataLOWSuresh27JAN20255885Non-Compliant237423802377358High Risk
12R012PuneMEDIUMKavita28JAN202579320Non-Compliant237423792378979Medium Risk
13R013HyderabadHIGHRamesh30JAN202595045Compliant237423772381695Low Risk
14R014MumbaiLOWAnil01FEB202562612Non-Compliant237733752378562Medium Risk
15R015DelhiMEDIUMKavita03FEB202570418Non-Compliant237733732379370Medium Risk
16R016ChennaiHIGHSuresh05FEB202582230Compliant237733712380782Low Risk

Macros help automate business logic and ensure consistency across studies.

8. FRAUD / RISK DETECTION LOGIC (MACRO)

%macro fraud_detection;

data food_inspection_fraud;

    set food_inspection_util;

    length Risk_Flag $12.;

    if Inspection_Score > 85 and Violations_Count > 5 then Risk_Flag = "Suspicious";

    else if Inspection_Score < 60 and Reinspection_Days > 25 then Risk_Flag = "Negligence";

    else Risk_Flag = "Normal";

run;

proc print data=food_inspection_fraud; 

 var Restaurant_ID City Hygiene_Level Inspector_Name Inspection_Score Violations_Count 

     Risk_Flag;

run;

%mend;


%fraud_detection;

OUTPUT:

ObsRestaurant_IDCityHygiene_LevelInspector_NameInspection_ScoreViolations_CountRisk_Flag
1R001HyderabadHIGHRamesh921Normal
2R002MumbaiLOWSuresh685Normal
3R003DelhiMEDIUMAnil753Normal
4R004ChennaiHIGHKavita882Normal
5R005KolkataLOWRamesh557Normal
6R006PuneMEDIUMAnil812Normal
7R007HyderabadLOWSuresh606Normal
8R008MumbaiHIGHKavita901Normal
9R009DelhiMEDIUMRamesh724Normal
10R010ChennaiHIGHAnil852Normal
11R011KolkataLOWSuresh588Normal
12R012PuneMEDIUMKavita793Normal
13R013HyderabadHIGHRamesh950Normal
14R014MumbaiLOWAnil626Normal
15R015DelhiMEDIUMKavita704Normal
16R016ChennaiHIGHSuresh822Normal

·  High score + many violations = possible manipulation

·  Low score + delayed reinspection = regulatory lapse

9. PROC SQL – BUSINESS SUMMARIES

proc sql;

    create table city_summary as

    select City,

           count(*) as Total_Restaurants,

           avg(Inspection_Score) as Avg_Score format=6.2,

           avg(Violations_Count) as Avg_Violations

    from food_inspection_fraud

    group by City;

quit;

proc print data=city_summary;

run;

OUTPUT:

ObsCityTotal_RestaurantsAvg_ScoreAvg_Violations
1Chennai385.002.00000
2Delhi372.333.66667
3Hyderabad382.332.33333
4Kolkata256.507.50000
5Mumbai373.334.00000
6Pune280.002.50000

10. PROC FREQ

proc freq data=food_inspection_fraud;

    tables City*Compliance_Status / nocum;

run;

OUTPUT:

The FREQ Procedure

Frequency
Percent
Row Pct
Col Pct
Table of City by Compliance_Status
CityCompliance_Status
CompliantNon-CompliantTotal
Chennai
3
18.75
100.00
42.86
0
0.00
0.00
0.00
3
18.75
 
 
Delhi
0
0.00
0.00
0.00
3
18.75
100.00
33.33
3
18.75
 
 
Hyderabad
2
12.50
66.67
28.57
1
6.25
33.33
11.11
3
18.75
 
 
Kolkata
0
0.00
0.00
0.00
2
12.50
100.00
22.22
2
12.50
 
 
Mumbai
1
6.25
33.33
14.29
2
12.50
66.67
22.22
3
18.75
 
 
Pune
1
6.25
50.00
14.29
1
6.25
50.00
11.11
2
12.50
 
 
Total
7
43.75
9
56.25
16
100.00
11. PROC MEANS

proc means data=food_inspection_fraud mean min max std;

    var Inspection_Score Violations_Count Reinspection_Days;

run;

OUTPUT:

The MEANS Procedure

VariableMeanMinimumMaximumStd Dev
Inspection_Score
Violations_Count
Reinspection_Days
75.7500000
3.5000000
21.1875000
55.0000000
0
5.0000000
95.0000000
8.0000000
45.0000000
12.7566976
2.3380904
10.6909229

12. PROC UNIVARIATE

proc univariate data=food_inspection_fraud;

    var Inspection_Score;

    histogram Inspection_Score;

run;

OUTPUT:

The UNIVARIATE Procedure

Variable: Inspection_Score

Moments
N16Sum Weights16
Mean75.75Sum Observations1212
Std Deviation12.7566976Variance162.733333
Skewness-0.160423Kurtosis-1.1980457
Uncorrected SS94250Corrected SS2441
Coeff Variation16.8405249Std Error Mean3.1891744
Basic Statistical Measures
LocationVariability
Mean75.75000Std Deviation12.75670
Median77.00000Variance162.73333
Mode.Range40.00000
  Interquartile Range21.50000
Tests for Location: Mu0=0
TestStatisticp Value
Student's tt23.75223Pr > |t|<.0001
SignM8Pr >= |M|<.0001
Signed RankS68Pr >= |S|<.0001
Quantiles (Definition 5)
LevelQuantile
100% Max95.0
99%95.0
95%95.0
90%92.0
75% Q386.5
50% Median77.0
25% Q165.0
10%58.0
5%55.0
1%55.0
0% Min55.0
Extreme Observations
LowestHighest
ValueObsValueObs
5558510
5811884
607908
6214921
6829513

The UNIVARIATE Procedure

Histogram for Inspection_Score

13. PROC CORR

proc corr data=food_inspection_fraud;

    var Inspection_Score Violations_Count Reinspection_Days;

run;

OUTPUT:

The CORR Procedure

3 Variables:Inspection_Score Violations_Count Reinspection_Days
Simple Statistics
VariableNMeanStd DevSumMinimumMaximum
Inspection_Score1675.7500012.75670121255.0000095.00000
Violations_Count163.500002.3380956.0000008.00000
Reinspection_Days1621.1875010.69092339.000005.0000045.00000
Pearson Correlation Coefficients, N = 16
Prob > |r| under H0: Rho=0
 Inspection_ScoreViolations_CountReinspection_Days
Inspection_Score
1.00000
 
-0.97677
<.0001
0.92132
<.0001
Violations_Count
-0.97677
<.0001
1.00000
 
-0.94280
<.0001
Reinspection_Days
0.92132
<.0001
-0.94280
<.0001
1.00000
 

14. PROC SGPLOT

proc sgplot data=food_inspection_fraud;

    vbox Inspection_Score / category=City;

run;

OUTPUT:

The SGPlot Procedure

15. TRANSPOSE

proc transpose data=city_summary out=city_transposed;

    id City;

    var Avg_Score;

run;

proc print data=city_transposed;

run;

OUTPUT:

Obs_NAME_ChennaiDelhiHyderabadKolkataMumbaiPune
1Avg_Score85.0072.3382.3356.5073.3380.00

16. SORT & MERGE 

proc sort data=food_inspection_fraud;by City;run;

proc print data=food_inspection_fraud;

run;

OUTPUT:

ObsRestaurant_IDCityHygiene_LevelInspector_NameInspection_DateInspection_ScoreViolations_CountReinspection_DaysCompliance_StatusInspection_MonthDays_Since_InspectionNext_Inspection_DateCompliance_PercentageUtilization_LevelRisk_Flag
1R004ChennaiHIGHKavita10JAN202588225Compliant237423972377688Medium RiskNormal
2R010ChennaiHIGHAnil25JAN202585228Compliant237423822379485Low RiskNormal
3R016ChennaiHIGHSuresh05FEB202582230Compliant237733712380782Low RiskNormal
4R003DelhiMEDIUMAnil07JAN202575320Non-Compliant237424002376875Medium RiskNormal
5R009DelhiMEDIUMRamesh22JAN202572415Non-Compliant237423852377872Medium RiskNormal
6R015DelhiMEDIUMKavita03FEB202570418Non-Compliant237733732379370Medium RiskNormal
7R001HyderabadHIGHRamesh01JAN202592130Compliant237424062377292Low RiskNormal
8R007HyderabadLOWSuresh18JAN202560614Non-Compliant237423892377360Medium RiskNormal
9R013HyderabadHIGHRamesh30JAN202595045Compliant237423772381695Low RiskNormal
10R005KolkataLOWRamesh12JAN20255577Non-Compliant237423952376055High RiskNormal
11R011KolkataLOWSuresh27JAN20255885Non-Compliant237423802377358High RiskNormal
12R002MumbaiLOWSuresh05JAN202568510Non-Compliant237424022375668High RiskNormal
13R008MumbaiHIGHKavita20JAN202590130Compliant237423872379190Low RiskNormal
14R014MumbaiLOWAnil01FEB202562612Non-Compliant237733752378562Medium RiskNormal
15R006PuneMEDIUMAnil15JAN202581230Compliant237423922378681Low RiskNormal
16R012PuneMEDIUMKavita28JAN202579320Non-Compliant237423792378979Medium RiskNormal

proc sort data=city_summary;by City;run;

proc print data=city_summary;

run;

OUTPUT:

ObsCityTotal_RestaurantsAvg_ScoreAvg_Violations
1Chennai385.002.00000
2Delhi372.333.66667
3Hyderabad382.332.33333
4Kolkata256.507.50000
5Mumbai373.334.00000
6Pune280.002.50000

data final_merged;

    merge food_inspection_fraud

          city_summary;

    by City;

run;

proc print data=final_merged;

run;

OUTPUT:

ObsRestaurant_IDCityHygiene_LevelInspector_NameInspection_DateInspection_ScoreViolations_CountReinspection_DaysCompliance_StatusInspection_MonthDays_Since_InspectionNext_Inspection_DateCompliance_PercentageUtilization_LevelRisk_FlagTotal_RestaurantsAvg_ScoreAvg_Violations
1R004ChennaiHIGHKavita10JAN202588225Compliant237423972377688Medium RiskNormal385.002.00000
2R010ChennaiHIGHAnil25JAN202585228Compliant237423822379485Low RiskNormal385.002.00000
3R016ChennaiHIGHSuresh05FEB202582230Compliant237733712380782Low RiskNormal385.002.00000
4R003DelhiMEDIUMAnil07JAN202575320Non-Compliant237424002376875Medium RiskNormal372.333.66667
5R009DelhiMEDIUMRamesh22JAN202572415Non-Compliant237423852377872Medium RiskNormal372.333.66667
6R015DelhiMEDIUMKavita03FEB202570418Non-Compliant237733732379370Medium RiskNormal372.333.66667
7R001HyderabadHIGHRamesh01JAN202592130Compliant237424062377292Low RiskNormal382.332.33333
8R007HyderabadLOWSuresh18JAN202560614Non-Compliant237423892377360Medium RiskNormal382.332.33333
9R013HyderabadHIGHRamesh30JAN202595045Compliant237423772381695Low RiskNormal382.332.33333
10R005KolkataLOWRamesh12JAN20255577Non-Compliant237423952376055High RiskNormal256.507.50000
11R011KolkataLOWSuresh27JAN20255885Non-Compliant237423802377358High RiskNormal256.507.50000
12R002MumbaiLOWSuresh05JAN202568510Non-Compliant237424022375668High RiskNormal373.334.00000
13R008MumbaiHIGHKavita20JAN202590130Compliant237423872379190Low RiskNormal373.334.00000
14R014MumbaiLOWAnil01FEB202562612Non-Compliant237733752378562Medium RiskNormal373.334.00000
15R006PuneMEDIUMAnil15JAN202581230Compliant237423922378681Low RiskNormal280.002.50000
16R012PuneMEDIUMKavita28JAN202579320Non-Compliant237423792378979Medium RiskNormal280.002.50000

17. PROC DATASETS DELETE

proc datasets library=work nolist;

    delete food_inspection_raw food_inspection_clean;

quit;

LOG:

NOTE: Deleting WORK.FOOD_INSPECTION_RAW (memtype=DATA).
NOTE: Deleting WORK.FOOD_INSPECTION_CLEAN (memtype=DATA).

18. BUSINESS INSIGHTS

·       Demonstrates end-to-end data lifecycle

·       Shows regulatory analytics

·       Uses advanced SAS techniques

·       Practical fraud detection logic

·       Clean, auditable, scalable code

19. Conclusion

This Food Safety Inspections SAS project clearly demonstrates how real-world inspection data can be created, cleaned, analyzed, and interpreted using SAS in a practical and business-oriented way. By combining DATA step programming, PROC SQL, statistical procedures, macros, and date and character functions, the project shows how food safety authorities can monitor restaurant hygiene, identify high-risk establishments, and ensure timely re-inspections.

The analysis helps in understanding relationships between inspection scores, violations, and reinspection timelines, while the fraud and risk detection logic highlights suspicious or negligent inspection patterns. Overall, this project reflects how SAS supports public health decision-making by turning raw inspection data into meaningful insights that improve food safety, regulatory compliance, and consumer protection in a simple and effective manner.


INTERVIEW QUESTIONS FOR YOU

·  What is MDY?

·  What is ROUND function?

·  What is the difference between MEAN and SUM?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

About the Author:

SAS Learning Hub is a data analytics and SAS programming platform focused on clinical, financial, and real-world data analysis. The content is created by professionals with academic training in Pharmaceutics and hands-on experience in Base SAS, PROC SQL, Macros, SDTM, and ADaM, providing practical and industry-relevant SAS learning resources.


Disclaimer:

The datasets and analysis in this article are created for educational and demonstration purposes only. They do not represent FOOD SAFETY data.


Our Mission:

This blog provides industry-focused SAS programming tutorials and analytics projects covering finance, healthcare, and technology.


This project is suitable for:

·  Students learning SAS

·  Data analysts building portfolios

·  Professionals preparing for SAS interviews

·  Bloggers writing about analytics and smart cities


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Follow Us On : 


 
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

--->Follow our blog for more SAS-based analytics projects and industry data models.

---> Support Us By Following Our Blog..

To deepen your understanding of SAS analytics, please refer to our other data science and industry-focused projects listed below:

1.Can SAS Identify Top Gaming Players Using Performance Data and Advanced Analytics?

2.Can SAS Data Analysis Accurately Measure a Sports Player’s True Performance Over Time?

3.Can SAS Analytics Reveal Differences Between Various Types of Neem Trees?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

About Us | Contact Privacy Policy

Comments

Popular posts from this blog

397.If a satellite has excellent signal strength but very high latency, can it still deliver good quality communication? Why or why not?A Sas Study

379.CAN SAS DELIVER END-TO-END TLF (TABLES, LISTINGS, AND FIGURES) FOR INSURANCE CLAIMS ANALYSIS?

184.HOW TO CREATE MOCK SHELLS AND CLINICAL DATA LISTINGS IN SAS USING DATA NULL | PROC PRINT | PROC REPORT | PROC SORT | PROC COMPARE | ODS PDF | ODS RTF | ODS EXCEL | A COMPLETE STEP-BY-STEP GUIDE FOR CLINICAL SAS PROGRAMMERS