209.ANALYZING COSTLIEST PERFUME WORLDWIDE ACROSS BRANDS COUNTRIES INGREDIENTS DESIGN AND PRICING USING PROC PRINT | PROC SORT | PROC MEANS | PROC SQL | PROC FREQ | PROC MACRO IN SAS FOR INSIGHTS AND REPORTING PURPOSES
- Get link
- X
- Other Apps
ANALYZING COSTLIEST PERFUME WORLDWIDE ACROSS BRANDS COUNTRIES INGREDIENTS DESIGN AND PRICING USING PROC PRINT | PROC SORT | PROC MEANS | PROC SQL | PROC FREQ | PROC MACRO IN SAS FOR INSIGHTS AND REPORTING PURPOSES
/*Creating A custom perfume dataset */
Step 1: Dataset Creation – COSTLY_PERFUMES
data Costly_Perfumes;
infile datalines dlm='|' dsd truncover;
length Perfume_Name $50 Brand $30 Country $20 Price_USD 8 Bottle_Size_ml 8
Key_Ingredient $20 Gender $10 Launch_Year 8 Bottle_Design $30;
input Perfume_ID
Perfume_Name : $50.
Brand : $30.
Country : $20.
Price_USD
Bottle_Size_ml
Key_Ingredient : $20.
Gender : $10.
Launch_Year
Bottle_Design : $30.;
datalines;
1|Shumukh|Spirit of Dubai|UAE|1400000|30|Ambergris|Unisex|2019|Jewel Embedded
2|DKNY Golden Delicious|DKNY|USA|1000000|100|White Diamond|Female|2011|Golden Apple
3|Clive Christian No1|Clive Christian|UK|215000|50|Sandalwood|Male|2001|Crystal Crown
4|Baccarat Les Larmes|Baccarat|France|6800|50|Jasmine|Female|2014|Crystal Tear
5|Roja Aoud Absolue Precieux|Roja UK|UK|3500|100|Oud|Male|2018|Gold Trimmed
6|Joy by Jean Patou|Jean Patou|France|850|75|Rose|Female|1930|Classic Glass
7|Caron Poiret|Caron|France|1200|60|Lavender|Unisex|2005|Handblown
8|Imperial Majesty|Clive Christian|UK|435000|500|Rose Oil|Female|2006|Baccarat Crystal
9|JAR Bolt of Lightning|JAR|France|765|50|Tuberose|Female|2001|Electric Bottle
10|Chanel No5 Limited|Chanel|France|4200|100|Aldehydes|Female|2008|Diamond Cap
11|Hermes 24 Faubourg|Hermes|France|1500|30|Orange Blossom|Female|1995|Elegant Sphere
12|Amouage Gold|Amouage|Oman|350|100|Incense|Male|1983|Gold Crested
13|House of Sillage Tiara|House of Sillage|USA|1200|75|Vanilla|Female|2012|Crystal Tiara
14|Bond No9 Swarovski|Bond No9|USA|1100|100|Musk|Unisex|2011|Swarovski Bottle
15|Annick Goutal 1001 Nights|Annick Goutal|France|800|75|Oud|Female|2010|Antique Bottle
16|Xerjoff Richwood|Xerjoff|Italy|470|100|Sandalwood|Male|2013|Rich Design
17|Tom Ford Umbre Leather|Tom Ford|USA|390|100|Leather|Male|2016|Sleek Black
18|Nishane Ani|Nishane|Turkey|420|50|Vanilla|Unisex|2020|Art Bottle
19|Creed Aventus|Creed|France|435|100|Pineapple|Male|2010|Classic Design
;
run;
proc print;run;
Output:
Obs | Perfume_Name | Brand | Country | Price_USD | Bottle_Size_ml | Key_Ingredient | Gender | Launch_Year | Bottle_Design | Perfume_ID |
---|---|---|---|---|---|---|---|---|---|---|
1 | Shumukh | Spirit of Dubai | UAE | 1400000 | 30 | Ambergris | Unisex | 2019 | Jewel Embedded | 1 |
2 | DKNY Golden Delicious | DKNY | USA | 1000000 | 100 | White Diamond | Female | 2011 | Golden Apple | 2 |
3 | Clive Christian No1 | Clive Christian | UK | 215000 | 50 | Sandalwood | Male | 2001 | Crystal Crown | 3 |
4 | Baccarat Les Larmes | Baccarat | France | 6800 | 50 | Jasmine | Female | 2014 | Crystal Tear | 4 |
5 | Roja Aoud Absolue Precieux | Roja UK | UK | 3500 | 100 | Oud | Male | 2018 | Gold Trimmed | 5 |
6 | Joy by Jean Patou | Jean Patou | France | 850 | 75 | Rose | Female | 1930 | Classic Glass | 6 |
7 | Caron Poiret | Caron | France | 1200 | 60 | Lavender | Unisex | 2005 | Handblown | 7 |
8 | Imperial Majesty | Clive Christian | UK | 435000 | 500 | Rose Oil | Female | 2006 | Baccarat Crystal | 8 |
9 | JAR Bolt of Lightning | JAR | France | 765 | 50 | Tuberose | Female | 2001 | Electric Bottle | 9 |
10 | Chanel No5 Limited | Chanel | France | 4200 | 100 | Aldehydes | Female | 2008 | Diamond Cap | 10 |
11 | Hermes 24 Faubourg | Hermes | France | 1500 | 30 | Orange Blossom | Female | 1995 | Elegant Sphere | 11 |
12 | Amouage Gold | Amouage | Oman | 350 | 100 | Incense | Male | 1983 | Gold Crested | 12 |
13 | House of Sillage Tiara | House of Sillage | USA | 1200 | 75 | Vanilla | Female | 2012 | Crystal Tiara | 13 |
14 | Bond No9 Swarovski | Bond No9 | USA | 1100 | 100 | Musk | Unisex | 2011 | Swarovski Bottle | 14 |
15 | Annick Goutal 1001 Nights | Annick Goutal | France | 800 | 75 | Oud | Female | 2010 | Antique Bottle | 15 |
16 | Xerjoff Richwood | Xerjoff | Italy | 470 | 100 | Sandalwood | Male | 2013 | Rich Design | 16 |
17 | Tom Ford Umbre Leather | Tom Ford | USA | 390 | 100 | Leather | Male | 2016 | Sleek Black | 17 |
18 | Nishane Ani | Nishane | Turkey | 420 | 50 | Vanilla | Unisex | 2020 | Art Bottle | 18 |
19 | Creed Aventus | Creed | France | 435 | 100 | Pineapple | Male | 2010 | Classic Design | 19 |
Step 2: PROC PRINT – View Raw Dataset
proc print data=Costly_Perfumes label;
title "Costliest Perfumes Worldwide - Raw Data View";
run;
Output:
Costliest Perfumes Worldwide - Raw Data View |
Obs | Perfume_Name | Brand | Country | Price_USD | Bottle_Size_ml | Key_Ingredient | Gender | Launch_Year | Bottle_Design | Perfume_ID |
---|---|---|---|---|---|---|---|---|---|---|
1 | Shumukh | Spirit of Dubai | UAE | 1400000 | 30 | Ambergris | Unisex | 2019 | Jewel Embedded | 1 |
2 | DKNY Golden Delicious | DKNY | USA | 1000000 | 100 | White Diamond | Female | 2011 | Golden Apple | 2 |
3 | Clive Christian No1 | Clive Christian | UK | 215000 | 50 | Sandalwood | Male | 2001 | Crystal Crown | 3 |
4 | Baccarat Les Larmes | Baccarat | France | 6800 | 50 | Jasmine | Female | 2014 | Crystal Tear | 4 |
5 | Roja Aoud Absolue Precieux | Roja UK | UK | 3500 | 100 | Oud | Male | 2018 | Gold Trimmed | 5 |
6 | Joy by Jean Patou | Jean Patou | France | 850 | 75 | Rose | Female | 1930 | Classic Glass | 6 |
7 | Caron Poiret | Caron | France | 1200 | 60 | Lavender | Unisex | 2005 | Handblown | 7 |
8 | Imperial Majesty | Clive Christian | UK | 435000 | 500 | Rose Oil | Female | 2006 | Baccarat Crystal | 8 |
9 | JAR Bolt of Lightning | JAR | France | 765 | 50 | Tuberose | Female | 2001 | Electric Bottle | 9 |
10 | Chanel No5 Limited | Chanel | France | 4200 | 100 | Aldehydes | Female | 2008 | Diamond Cap | 10 |
11 | Hermes 24 Faubourg | Hermes | France | 1500 | 30 | Orange Blossom | Female | 1995 | Elegant Sphere | 11 |
12 | Amouage Gold | Amouage | Oman | 350 | 100 | Incense | Male | 1983 | Gold Crested | 12 |
13 | House of Sillage Tiara | House of Sillage | USA | 1200 | 75 | Vanilla | Female | 2012 | Crystal Tiara | 13 |
14 | Bond No9 Swarovski | Bond No9 | USA | 1100 | 100 | Musk | Unisex | 2011 | Swarovski Bottle | 14 |
15 | Annick Goutal 1001 Nights | Annick Goutal | France | 800 | 75 | Oud | Female | 2010 | Antique Bottle | 15 |
16 | Xerjoff Richwood | Xerjoff | Italy | 470 | 100 | Sandalwood | Male | 2013 | Rich Design | 16 |
17 | Tom Ford Umbre Leather | Tom Ford | USA | 390 | 100 | Leather | Male | 2016 | Sleek Black | 17 |
18 | Nishane Ani | Nishane | Turkey | 420 | 50 | Vanilla | Unisex | 2020 | Art Bottle | 18 |
19 | Creed Aventus | Creed | France | 435 | 100 | Pineapple | Male | 2010 | Classic Design | 19 |
Step 3: PROC SORT – Sorting by Price
proc sort data=Costly_Perfumes out=Sorted_Perfumes;
by descending Price_USD;
run;
proc print data=Sorted_Perfumes(obs=10);
title "Top 10 Most Expensive Perfumes by Price";
run;
Output:
Top 10 Most Expensive Perfumes by Price |
Obs | Perfume_Name | Brand | Country | Price_USD | Bottle_Size_ml | Key_Ingredient | Gender | Launch_Year | Bottle_Design | Perfume_ID |
---|---|---|---|---|---|---|---|---|---|---|
1 | Shumukh | Spirit of Dubai | UAE | 1400000 | 30 | Ambergris | Unisex | 2019 | Jewel Embedded | 1 |
2 | DKNY Golden Delicious | DKNY | USA | 1000000 | 100 | White Diamond | Female | 2011 | Golden Apple | 2 |
3 | Imperial Majesty | Clive Christian | UK | 435000 | 500 | Rose Oil | Female | 2006 | Baccarat Crystal | 8 |
4 | Clive Christian No1 | Clive Christian | UK | 215000 | 50 | Sandalwood | Male | 2001 | Crystal Crown | 3 |
5 | Baccarat Les Larmes | Baccarat | France | 6800 | 50 | Jasmine | Female | 2014 | Crystal Tear | 4 |
6 | Chanel No5 Limited | Chanel | France | 4200 | 100 | Aldehydes | Female | 2008 | Diamond Cap | 10 |
7 | Roja Aoud Absolue Precieux | Roja UK | UK | 3500 | 100 | Oud | Male | 2018 | Gold Trimmed | 5 |
8 | Hermes 24 Faubourg | Hermes | France | 1500 | 30 | Orange Blossom | Female | 1995 | Elegant Sphere | 11 |
9 | Caron Poiret | Caron | France | 1200 | 60 | Lavender | Unisex | 2005 | Handblown | 7 |
10 | House of Sillage Tiara | House of Sillage | USA | 1200 | 75 | Vanilla | Female | 2012 | Crystal Tiara | 13 |
Step 4: PROC MEANS – Price Summary
proc means data=Costly_Perfumes mean min max median maxdec=2;
var Price_USD Bottle_Size_ml Launch_Year;
title "Descriptive Statistics on Price, Bottle Size and Launch Year";
run;
Output:
Descriptive Statistics on Price, Bottle Size and Launch Year |
Variable | Mean | Minimum | Maximum | Median | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
Step 5: PROC FREQ – Gender & Country Distribution
proc freq data=Costly_Perfumes;
tables Gender Country;
title "Frequency Distribution by Gender and Country of Origin";
run;
Output:
Frequency Distribution by Gender and Country of Origin |
Gender | Frequency | Percent | Cumulative Frequency |
Cumulative Percent |
---|---|---|---|---|
Female | 9 | 47.37 | 9 | 47.37 |
Male | 6 | 31.58 | 15 | 78.95 |
Unisex | 4 | 21.05 | 19 | 100.00 |
Country | Frequency | Percent | Cumulative Frequency |
Cumulative Percent |
---|---|---|---|---|
France | 8 | 42.11 | 8 | 42.11 |
Italy | 1 | 5.26 | 9 | 47.37 |
Oman | 1 | 5.26 | 10 | 52.63 |
Turkey | 1 | 5.26 | 11 | 57.89 |
UAE | 1 | 5.26 | 12 | 63.16 |
UK | 3 | 15.79 | 15 | 78.95 |
USA | 4 | 21.05 | 19 | 100.00 |
Step 6: PROC SQL – Advanced Queries
a. Average Price by Country
proc sql;
select Country, count(*) as Perfume_Count,
avg(Price_USD) as Avg_Price format=dollar12.2
from Costly_Perfumes
group by Country
order by Avg_Price desc;
quit;
Output:
Country | Perfume_Count | Avg_Price |
---|---|---|
UAE | 1 | $1400000.00 |
USA | 4 | $250,672.50 |
UK | 3 | $217,833.33 |
France | 8 | $2,068.75 |
Italy | 1 | $470.00 |
Turkey | 1 | $420.00 |
Oman | 1 | $350.00 |
b. Perfumes launched after 2010 above $1000
proc sql;
select Perfume_Name, Brand, Country, Price_USD, Launch_Year
from Costly_Perfumes
where Launch_Year > 2010 and Price_USD > 1000
order by Price_USD desc;
quit;
Output:
Perfume_Name | Brand | Country | Price_USD | Launch_Year |
---|---|---|---|---|
Shumukh | Spirit of Dubai | UAE | 1400000 | 2019 |
DKNY Golden Delicious | DKNY | USA | 1000000 | 2011 |
Baccarat Les Larmes | Baccarat | France | 6800 | 2014 |
Roja Aoud Absolue Precieux | Roja UK | UK | 3500 | 2018 |
House of Sillage Tiara | House of Sillage | USA | 1200 | 2012 |
Bond No9 Swarovski | Bond No9 | USA | 1100 | 2011 |
Step 7: PROC FORMAT – Enhance Presentation
proc format;
value $genderfmt
'Male'='For Men'
'Female'='For Women'
'Unisex'='For All';
value pricefmt
low-999 = 'Affordable Luxury'
1000-10000 = 'Premium Luxury'
10001-high = 'Ultra Luxury';
run;
proc print data=Costly_Perfumes;
format Gender $genderfmt. Price_USD pricefmt.;
title "Perfumes with Formatted Gender and Price Category";
run;
Output:
Perfumes with Formatted Gender and Price Category |
Obs | Perfume_Name | Brand | Country | Price_USD | Bottle_Size_ml | Key_Ingredient | Gender | Launch_Year | Bottle_Design | Perfume_ID |
---|---|---|---|---|---|---|---|---|---|---|
1 | Shumukh | Spirit of Dubai | UAE | Ultra Luxury | 30 | Ambergris | For All | 2019 | Jewel Embedded | 1 |
2 | DKNY Golden Delicious | DKNY | USA | Ultra Luxury | 100 | White Diamond | For Women | 2011 | Golden Apple | 2 |
3 | Clive Christian No1 | Clive Christian | UK | Ultra Luxury | 50 | Sandalwood | For Men | 2001 | Crystal Crown | 3 |
4 | Baccarat Les Larmes | Baccarat | France | Premium Luxury | 50 | Jasmine | For Women | 2014 | Crystal Tear | 4 |
5 | Roja Aoud Absolue Precieux | Roja UK | UK | Premium Luxury | 100 | Oud | For Men | 2018 | Gold Trimmed | 5 |
6 | Joy by Jean Patou | Jean Patou | France | Affordable Luxury | 75 | Rose | For Women | 1930 | Classic Glass | 6 |
7 | Caron Poiret | Caron | France | Premium Luxury | 60 | Lavender | For All | 2005 | Handblown | 7 |
8 | Imperial Majesty | Clive Christian | UK | Ultra Luxury | 500 | Rose Oil | For Women | 2006 | Baccarat Crystal | 8 |
9 | JAR Bolt of Lightning | JAR | France | Affordable Luxury | 50 | Tuberose | For Women | 2001 | Electric Bottle | 9 |
10 | Chanel No5 Limited | Chanel | France | Premium Luxury | 100 | Aldehydes | For Women | 2008 | Diamond Cap | 10 |
11 | Hermes 24 Faubourg | Hermes | France | Premium Luxury | 30 | Orange Blossom | For Women | 1995 | Elegant Sphere | 11 |
12 | Amouage Gold | Amouage | Oman | Affordable Luxury | 100 | Incense | For Men | 1983 | Gold Crested | 12 |
13 | House of Sillage Tiara | House of Sillage | USA | Premium Luxury | 75 | Vanilla | For Women | 2012 | Crystal Tiara | 13 |
14 | Bond No9 Swarovski | Bond No9 | USA | Premium Luxury | 100 | Musk | For All | 2011 | Swarovski Bottle | 14 |
15 | Annick Goutal 1001 Nights | Annick Goutal | France | Affordable Luxury | 75 | Oud | For Women | 2010 | Antique Bottle | 15 |
16 | Xerjoff Richwood | Xerjoff | Italy | Affordable Luxury | 100 | Sandalwood | For Men | 2013 | Rich Design | 16 |
17 | Tom Ford Umbre Leather | Tom Ford | USA | Affordable Luxury | 100 | Leather | For Men | 2016 | Sleek Black | 17 |
18 | Nishane Ani | Nishane | Turkey | Affordable Luxury | 50 | Vanilla | For All | 2020 | Art Bottle | 18 |
19 | Creed Aventus | Creed | France | Affordable Luxury | 100 | Pineapple | For Men | 2010 | Classic Design | 19 |
Step 8: SAS MACRO – Filter Perfumes Over a Price Threshold
%macro FilterExpensivePerfumes(threshold);
proc sql;
select Perfume_Name, Brand, Country, Price_USD
from Costly_Perfumes
where Price_USD > &threshold
order by Price_USD desc;
quit;
%mend;
%FilterExpensivePerfumes(10000);
Output:
Perfume_Name | Brand | Country | Price_USD |
---|---|---|---|
Shumukh | Spirit of Dubai | UAE | 1400000 |
DKNY Golden Delicious | DKNY | USA | 1000000 |
Imperial Majesty | Clive Christian | UK | 435000 |
Clive Christian No1 | Clive Christian | UK | 215000 |
Step 10: Visual Summary
proc sgplot data=Costly_Perfumes;
vbar Country / response=Price_USD stat=mean datalabel;
title "Average Price of Perfumes by Country";
run;
To Visit My Previous Sas Macro Functions:Click HereTo Visit My Previous lnput Proc Sql In Sas:Click HereTo Visit My Previous Advanced Clinical Trials:Click HereTo Visit My Previous Urban Traffic Pattern Dataset:Click Here--->PLEASE FOLLOW OUR BLOG FOR MORE INFORMATION.--->PLEASE DO COMMENTS AND SHARE OUR BLOG.PLEASE FOLLOW OUR INSTAGRAM PAGE CLICK HERE
- Get link
- X
- Other Apps
Comments
Post a Comment