245.SHAMPOO MARKET ANALYSIS IN INDIA USING PROC PRINT | PROC SORT | PROC FREQ | PROC MEANS | PROC SQL | MACROS | DATA DERIVATION | INSIGHTS GENERATION IN SAS
- Get link
- X
- Other Apps
SHAMPOO MARKET ANALYSIS IN INDIA USING PROC PRINT | PROC SORT | PROC FREQ | PROC MEANS | PROC SQL | MACROS | DATA DERIVATION | INSIGHTS GENERATION IN SAS
/* Creating a unique dataset for Indian shampoos */
STEP 1: DATA CREATION
options nocenter;
data indian_shampoos;
length Brand $20 Variant $25 Type $20 Gender $10 Herbal $3 SulfateFree $3 Fragrance $15;
input Brand $ Variant $ Price Volume_in_ml Type $ Gender $ Herbal $ SulfateFree $
Fragrance $ Rating;
datalines;
Dove DailyShine 180 180 Moisturizing Unisex No No Mild 4.2
Dove IntenseRepair 210 340 Repair Unisex No No Floral 4.5
Pantene HairFallControl 160 180 AntiHairFall Female No No Floral 4.0
Pantene LivelyClean 140 180 Cleansing Unisex No No Citrus 4.1
HeadShoulders AntiDandruff 175 180 AntiDandruff Male No No Mint 4.3
HeadShoulders CoolMenthol 190 340 AntiDandruff Male No No Menthol 4.6
ClinicPlus StrongScalp 130 180 Nourishing Female No No Herbal 4.0
ClinicPlus HealthCare 150 340 Nourishing Female No No Herbal 3.9
Sunsilk BlackShine 160 180 Shine Female No No Fruity 4.2
Sunsilk LusciouslyThick 180 340 Volume Female No No Floral 4.3
Himalaya AntiHairFall 140 200 Herbal Female Yes Yes Herbal 4.5
Himalaya Protein 130 200 Nourishing Unisex Yes Yes Herbal 4.4
Khadi NeemAloe 180 210 Herbal Unisex Yes Yes Herbal 4.7
Khadi Shikakai 170 200 Herbal Unisex Yes Yes Herbal 4.6
Biotique BioKelp 190 200 Herbal Unisex Yes Yes Herbal 4.5
Biotique GreenApple 160 200 OilyScalp Unisex Yes Yes Fruity 4.4
WOW AppleCider 499 300 Herbal Unisex Yes Yes Apple 4.8
WOW OnionBlackSeed 599 300 Herbal Unisex Yes Yes Onion 4.7
Mamaearth Onion 349 250 Herbal Unisex Yes Yes Onion 4.6
Mamaearth TeaTree 329 250 AntiDandruff Unisex Yes Yes TeaTree 4.5
Tresemme KeratinSmooth 220 340 Smoothing Female No No Floral 4.3
Tresemme Botanique 250 340 Herbal Female Yes Yes Floral 4.4
L'Oreal TotalRepair 299 340 Repair Female No No Floral 4.4
L'Oreal FallResist 279 340 AntiHairFall Female No No Mild 4.2
Nyle DamageRepair 150 180 Repair Unisex Yes Yes Herbal 4.1
Nyle AntiDandruff 160 180 AntiDandruff Unisex Yes Yes Herbal 4.2
Ayush AntiDandruff 120 180 Herbal Unisex Yes Yes Herbal 4.3
Ayush ThickGrowth 130 180 Herbal Unisex Yes Yes Herbal 4.4
VLCC ProteinShampoo 199 200 Nourishing Unisex Yes Yes Mild 4.1
Meera Shikakai 110 180 Herbal Female Yes Yes Herbal 4.2
ParkAvenue BeerShampoo 225 350 AntiDandruff Male No Yes Beer 4.5
;
run;
proc print;run;
Output:
Obs | Brand | Variant | Type | Gender | Herbal | SulfateFree | Fragrance | Price | Volume_in_ml | Rating |
---|---|---|---|---|---|---|---|---|---|---|
1 | Dove | DailyShine | Moisturizing | Unisex | No | No | Mild | 180 | 180 | 4.2 |
2 | Dove | IntenseRepair | Repair | Unisex | No | No | Floral | 210 | 340 | 4.5 |
3 | Pantene | HairFallControl | AntiHairFall | Female | No | No | Floral | 160 | 180 | 4.0 |
4 | Pantene | LivelyClean | Cleansing | Unisex | No | No | Citrus | 140 | 180 | 4.1 |
5 | HeadShoulders | AntiDandruff | AntiDandruff | Male | No | No | Mint | 175 | 180 | 4.3 |
6 | HeadShoulders | CoolMenthol | AntiDandruff | Male | No | No | Menthol | 190 | 340 | 4.6 |
7 | ClinicPlus | StrongScalp | Nourishing | Female | No | No | Herbal | 130 | 180 | 4.0 |
8 | ClinicPlus | HealthCare | Nourishing | Female | No | No | Herbal | 150 | 340 | 3.9 |
9 | Sunsilk | BlackShine | Shine | Female | No | No | Fruity | 160 | 180 | 4.2 |
10 | Sunsilk | LusciouslyThick | Volume | Female | No | No | Floral | 180 | 340 | 4.3 |
11 | Himalaya | AntiHairFall | Herbal | Female | Yes | Yes | Herbal | 140 | 200 | 4.5 |
12 | Himalaya | Protein | Nourishing | Unisex | Yes | Yes | Herbal | 130 | 200 | 4.4 |
13 | Khadi | NeemAloe | Herbal | Unisex | Yes | Yes | Herbal | 180 | 210 | 4.7 |
14 | Khadi | Shikakai | Herbal | Unisex | Yes | Yes | Herbal | 170 | 200 | 4.6 |
15 | Biotique | BioKelp | Herbal | Unisex | Yes | Yes | Herbal | 190 | 200 | 4.5 |
16 | Biotique | GreenApple | OilyScalp | Unisex | Yes | Yes | Fruity | 160 | 200 | 4.4 |
17 | WOW | AppleCider | Herbal | Unisex | Yes | Yes | Apple | 499 | 300 | 4.8 |
18 | WOW | OnionBlackSeed | Herbal | Unisex | Yes | Yes | Onion | 599 | 300 | 4.7 |
19 | Mamaearth | Onion | Herbal | Unisex | Yes | Yes | Onion | 349 | 250 | 4.6 |
20 | Mamaearth | TeaTree | AntiDandruff | Unisex | Yes | Yes | TeaTree | 329 | 250 | 4.5 |
21 | Tresemme | KeratinSmooth | Smoothing | Female | No | No | Floral | 220 | 340 | 4.3 |
22 | Tresemme | Botanique | Herbal | Female | Yes | Yes | Floral | 250 | 340 | 4.4 |
23 | L'Oreal | TotalRepair | Repair | Female | No | No | Floral | 299 | 340 | 4.4 |
24 | L'Oreal | FallResist | AntiHairFall | Female | No | No | Mild | 279 | 340 | 4.2 |
25 | Nyle | DamageRepair | Repair | Unisex | Yes | Yes | Herbal | 150 | 180 | 4.1 |
26 | Nyle | AntiDandruff | AntiDandruff | Unisex | Yes | Yes | Herbal | 160 | 180 | 4.2 |
27 | Ayush | AntiDandruff | Herbal | Unisex | Yes | Yes | Herbal | 120 | 180 | 4.3 |
28 | Ayush | ThickGrowth | Herbal | Unisex | Yes | Yes | Herbal | 130 | 180 | 4.4 |
29 | VLCC | ProteinShampoo | Nourishing | Unisex | Yes | Yes | Mild | 199 | 200 | 4.1 |
30 | Meera | Shikakai | Herbal | Female | Yes | Yes | Herbal | 110 | 180 | 4.2 |
31 | ParkAvenue | BeerShampoo | AntiDandruff | Male | No | Yes | Beer | 225 | 350 | 4.5 |
STEP 2: VIEWING THE DATA USING PROC PRINT
proc print data=indian_shampoos;
title "Complete List of Indian Shampoos Dataset";
run;
Output:
Complete List of Indian Shampoos Dataset
Obs | Brand | Variant | Type | Gender | Herbal | SulfateFree | Fragrance | Price | Volume_in_ml | Rating |
---|---|---|---|---|---|---|---|---|---|---|
1 | Dove | DailyShine | Moisturizing | Unisex | No | No | Mild | 180 | 180 | 4.2 |
2 | Dove | IntenseRepair | Repair | Unisex | No | No | Floral | 210 | 340 | 4.5 |
3 | Pantene | HairFallControl | AntiHairFall | Female | No | No | Floral | 160 | 180 | 4.0 |
4 | Pantene | LivelyClean | Cleansing | Unisex | No | No | Citrus | 140 | 180 | 4.1 |
5 | HeadShoulders | AntiDandruff | AntiDandruff | Male | No | No | Mint | 175 | 180 | 4.3 |
6 | HeadShoulders | CoolMenthol | AntiDandruff | Male | No | No | Menthol | 190 | 340 | 4.6 |
7 | ClinicPlus | StrongScalp | Nourishing | Female | No | No | Herbal | 130 | 180 | 4.0 |
8 | ClinicPlus | HealthCare | Nourishing | Female | No | No | Herbal | 150 | 340 | 3.9 |
9 | Sunsilk | BlackShine | Shine | Female | No | No | Fruity | 160 | 180 | 4.2 |
10 | Sunsilk | LusciouslyThick | Volume | Female | No | No | Floral | 180 | 340 | 4.3 |
11 | Himalaya | AntiHairFall | Herbal | Female | Yes | Yes | Herbal | 140 | 200 | 4.5 |
12 | Himalaya | Protein | Nourishing | Unisex | Yes | Yes | Herbal | 130 | 200 | 4.4 |
13 | Khadi | NeemAloe | Herbal | Unisex | Yes | Yes | Herbal | 180 | 210 | 4.7 |
14 | Khadi | Shikakai | Herbal | Unisex | Yes | Yes | Herbal | 170 | 200 | 4.6 |
15 | Biotique | BioKelp | Herbal | Unisex | Yes | Yes | Herbal | 190 | 200 | 4.5 |
16 | Biotique | GreenApple | OilyScalp | Unisex | Yes | Yes | Fruity | 160 | 200 | 4.4 |
17 | WOW | AppleCider | Herbal | Unisex | Yes | Yes | Apple | 499 | 300 | 4.8 |
18 | WOW | OnionBlackSeed | Herbal | Unisex | Yes | Yes | Onion | 599 | 300 | 4.7 |
19 | Mamaearth | Onion | Herbal | Unisex | Yes | Yes | Onion | 349 | 250 | 4.6 |
20 | Mamaearth | TeaTree | AntiDandruff | Unisex | Yes | Yes | TeaTree | 329 | 250 | 4.5 |
21 | Tresemme | KeratinSmooth | Smoothing | Female | No | No | Floral | 220 | 340 | 4.3 |
22 | Tresemme | Botanique | Herbal | Female | Yes | Yes | Floral | 250 | 340 | 4.4 |
23 | L'Oreal | TotalRepair | Repair | Female | No | No | Floral | 299 | 340 | 4.4 |
24 | L'Oreal | FallResist | AntiHairFall | Female | No | No | Mild | 279 | 340 | 4.2 |
25 | Nyle | DamageRepair | Repair | Unisex | Yes | Yes | Herbal | 150 | 180 | 4.1 |
26 | Nyle | AntiDandruff | AntiDandruff | Unisex | Yes | Yes | Herbal | 160 | 180 | 4.2 |
27 | Ayush | AntiDandruff | Herbal | Unisex | Yes | Yes | Herbal | 120 | 180 | 4.3 |
28 | Ayush | ThickGrowth | Herbal | Unisex | Yes | Yes | Herbal | 130 | 180 | 4.4 |
29 | VLCC | ProteinShampoo | Nourishing | Unisex | Yes | Yes | Mild | 199 | 200 | 4.1 |
30 | Meera | Shikakai | Herbal | Female | Yes | Yes | Herbal | 110 | 180 | 4.2 |
31 | ParkAvenue | BeerShampoo | AntiDandruff | Male | No | Yes | Beer | 225 | 350 | 4.5 |
STEP 3: SORTING DATA USING PROC SORT
proc sort data=indian_shampoos out=sorted_shampoos;
by descending Price;
run;
proc print data=sorted_shampoos(obs=10);
title "Top 10 Most Expensive Shampoos in India";
run;
Output:
Top 10 Most Expensive Shampoos in India
Obs | Brand | Variant | Type | Gender | Herbal | SulfateFree | Fragrance | Price | Volume_in_ml | Rating |
---|---|---|---|---|---|---|---|---|---|---|
1 | WOW | OnionBlackSeed | Herbal | Unisex | Yes | Yes | Onion | 599 | 300 | 4.7 |
2 | WOW | AppleCider | Herbal | Unisex | Yes | Yes | Apple | 499 | 300 | 4.8 |
3 | Mamaearth | Onion | Herbal | Unisex | Yes | Yes | Onion | 349 | 250 | 4.6 |
4 | Mamaearth | TeaTree | AntiDandruff | Unisex | Yes | Yes | TeaTree | 329 | 250 | 4.5 |
5 | L'Oreal | TotalRepair | Repair | Female | No | No | Floral | 299 | 340 | 4.4 |
6 | L'Oreal | FallResist | AntiHairFall | Female | No | No | Mild | 279 | 340 | 4.2 |
7 | Tresemme | Botanique | Herbal | Female | Yes | Yes | Floral | 250 | 340 | 4.4 |
8 | ParkAvenue | BeerShampoo | AntiDandruff | Male | No | Yes | Beer | 225 | 350 | 4.5 |
9 | Tresemme | KeratinSmooth | Smoothing | Female | No | No | Floral | 220 | 340 | 4.3 |
10 | Dove | IntenseRepair | Repair | Unisex | No | No | Floral | 210 | 340 | 4.5 |
STEP 4: FREQUENCY DISTRIBUTION USING PROC FREQ
1. Frequency of Shampoo Type
proc freq data=indian_shampoos;
tables Type;
title "Distribution of Shampoo Types";
run;
Output:
Distribution of Shampoo Types
The FREQ Procedure
Type | Frequency | Percent | Cumulative Frequency | Cumulative Percent |
---|---|---|---|---|
AntiDandruff | 5 | 16.13 | 5 | 16.13 |
AntiHairFall | 2 | 6.45 | 7 | 22.58 |
Cleansing | 1 | 3.23 | 8 | 25.81 |
Herbal | 11 | 35.48 | 19 | 61.29 |
Moisturizing | 1 | 3.23 | 20 | 64.52 |
Nourishing | 4 | 12.90 | 24 | 77.42 |
OilyScalp | 1 | 3.23 | 25 | 80.65 |
Repair | 3 | 9.68 | 28 | 90.32 |
Shine | 1 | 3.23 | 29 | 93.55 |
Smoothing | 1 | 3.23 | 30 | 96.77 |
Volume | 1 | 3.23 | 31 | 100.00 |
2. Herbal vs. Non-Herbal
proc freq data=indian_shampoos;
tables Herbal SulfateFree;
title "Herbal and Sulfate-Free Shampoo Counts";
run;
Output:
Herbal and Sulfate-Free Shampoo Counts
The FREQ Procedure
Herbal | Frequency | Percent | Cumulative Frequency | Cumulative Percent |
---|---|---|---|---|
No | 14 | 45.16 | 14 | 45.16 |
Yes | 17 | 54.84 | 31 | 100.00 |
SulfateFree | Frequency | Percent | Cumulative Frequency | Cumulative Percent |
---|---|---|---|---|
No | 13 | 41.94 | 13 | 41.94 |
Yes | 18 | 58.06 | 31 | 100.00 |
STEP 5: STATISTICAL SUMMARY USING PROC MEANS
Summary for Price and Volume
proc means data=indian_shampoos n mean min max std;
var Price Volume_in_ml Rating;
title "Statistical Summary: Price | Volume | Rating";
run;
Output:
Statistical Summary: Price | Volume | Rating
The MEANS Procedure
Variable | N | Mean | Minimum | Maximum | Std Dev |
---|---|---|---|---|---|
Price Volume_in_ml Rating | 31 31 31 | 211.7096774 243.8709677 4.3516129 | 110.0000000 180.0000000 3.9000000 | 599.0000000 350.0000000 4.8000000 | 108.5643261 70.5066153 0.2249014 |
STEP 6: FILTERED REPORTS USING PROC SQL
1. List All Herbal and Sulfate-Free Products
proc sql;
select Brand, Variant, Price, Volume_in_ml
from indian_shampoos
where Herbal = "Yes" and SulfateFree = "Yes";
quit;
Output:
Brand | Variant | Price | Volume_in_ml |
---|---|---|---|
Himalaya | AntiHairFall | 140 | 200 |
Himalaya | Protein | 130 | 200 |
Khadi | NeemAloe | 180 | 210 |
Khadi | Shikakai | 170 | 200 |
Biotique | BioKelp | 190 | 200 |
Biotique | GreenApple | 160 | 200 |
WOW | AppleCider | 499 | 300 |
WOW | OnionBlackSeed | 599 | 300 |
Mamaearth | Onion | 349 | 250 |
Mamaearth | TeaTree | 329 | 250 |
Tresemme | Botanique | 250 | 340 |
Nyle | DamageRepair | 150 | 180 |
Nyle | AntiDandruff | 160 | 180 |
Ayush | AntiDandruff | 120 | 180 |
Ayush | ThickGrowth | 130 | 180 |
VLCC | ProteinShampoo | 199 | 200 |
Meera | Shikakai | 110 | 180 |
2. Top 5 Rated Shampoos
proc sql outobs=5;
select Brand, Variant, Rating
from indian_shampoos
order by Rating desc;
quit;
Output:
Brand | Variant | Rating |
---|---|---|
WOW | AppleCider | 4.8 |
Khadi | NeemAloe | 4.7 |
WOW | OnionBlackSeed | 4.7 |
HeadShoulders | CoolMenthol | 4.6 |
Mamaearth | Onion | 4.6 |
3. Average Price by Type
proc sql;
select Type, avg(Price) as AvgPrice
from indian_shampoos
group by Type;
quit;
Output:
Type | AvgPrice |
---|---|
AntiDandruff | 215.8 |
AntiHairFall | 219.5 |
Cleansing | 140 |
Herbal | 248.8182 |
Moisturizing | 180 |
Nourishing | 152.25 |
OilyScalp | 160 |
Repair | 219.6667 |
Shine | 160 |
Smoothing | 220 |
Volume | 180 |
STEP 7: USING MACROS TO FILTER SHAMPOOS BY TARGET GENDER
%macro filter_gender(g);
proc print data=indian_shampoos;
where Gender = "&g";
title "Shampoos Targeted for &g Users";
run;
%mend filter_gender;
%filter_gender(Female);
Output:
Shampoos Targeted for Female Users
Obs | Brand | Variant | Type | Gender | Herbal | SulfateFree | Fragrance | Price | Volume_in_ml | Rating |
---|---|---|---|---|---|---|---|---|---|---|
3 | Pantene | HairFallControl | AntiHairFall | Female | No | No | Floral | 160 | 180 | 4.0 |
7 | ClinicPlus | StrongScalp | Nourishing | Female | No | No | Herbal | 130 | 180 | 4.0 |
8 | ClinicPlus | HealthCare | Nourishing | Female | No | No | Herbal | 150 | 340 | 3.9 |
9 | Sunsilk | BlackShine | Shine | Female | No | No | Fruity | 160 | 180 | 4.2 |
10 | Sunsilk | LusciouslyThick | Volume | Female | No | No | Floral | 180 | 340 | 4.3 |
11 | Himalaya | AntiHairFall | Herbal | Female | Yes | Yes | Herbal | 140 | 200 | 4.5 |
21 | Tresemme | KeratinSmooth | Smoothing | Female | No | No | Floral | 220 | 340 | 4.3 |
22 | Tresemme | Botanique | Herbal | Female | Yes | Yes | Floral | 250 | 340 | 4.4 |
23 | L'Oreal | TotalRepair | Repair | Female | No | No | Floral | 299 | 340 | 4.4 |
24 | L'Oreal | FallResist | AntiHairFall | Female | No | No | Mild | 279 | 340 | 4.2 |
30 | Meera | Shikakai | Herbal | Female | Yes | Yes | Herbal | 110 | 180 | 4.2 |
%filter_gender(Male);
Output:
Shampoos Targeted for Male Users
Obs | Brand | Variant | Type | Gender | Herbal | SulfateFree | Fragrance | Price | Volume_in_ml | Rating |
---|---|---|---|---|---|---|---|---|---|---|
5 | HeadShoulders | AntiDandruff | AntiDandruff | Male | No | No | Mint | 175 | 180 | 4.3 |
6 | HeadShoulders | CoolMenthol | AntiDandruff | Male | No | No | Menthol | 190 | 340 | 4.6 |
31 | ParkAvenue | BeerShampoo | AntiDandruff | Male | No | Yes | Beer | 225 | 350 | 4.5 |
STEP 8: MACRO FOR DYNAMIC PRICE RANGE FILTER
%macro price_range(min, max);
proc sql;
select Brand, Variant, Price
from indian_shampoos
where Price between &min and &max;
quit;
%mend price_range;
%price_range(100, 200);
Output:
Brand | Variant | Price |
---|---|---|
Dove | DailyShine | 180 |
Pantene | HairFallControl | 160 |
Pantene | LivelyClean | 140 |
HeadShoulders | AntiDandruff | 175 |
HeadShoulders | CoolMenthol | 190 |
ClinicPlus | StrongScalp | 130 |
ClinicPlus | HealthCare | 150 |
Sunsilk | BlackShine | 160 |
Sunsilk | LusciouslyThick | 180 |
Himalaya | AntiHairFall | 140 |
Himalaya | Protein | 130 |
Khadi | NeemAloe | 180 |
Khadi | Shikakai | 170 |
Biotique | BioKelp | 190 |
Biotique | GreenApple | 160 |
Nyle | DamageRepair | 150 |
Nyle | AntiDandruff | 160 |
Ayush | AntiDandruff | 120 |
Ayush | ThickGrowth | 130 |
VLCC | ProteinShampoo | 199 |
Meera | Shikakai | 110 |
STEP 9: DERIVED VARIABLES – PRICE PER 100ml
data shampoo_metrics;
set indian_shampoos;
PricePer100ml = round((Price / Volume_in_ml) * 100, .01);
run;
proc print data=shampoo_metrics (obs=10);
var Brand Variant Price Volume_in_ml PricePer100ml;
title "Shampoos with Price per 100ml Calculated";
run;
Output:
Shampoos with Price per 100ml Calculated
Obs | Brand | Variant | Price | Volume_in_ml | PricePer100ml |
---|---|---|---|---|---|
1 | Dove | DailyShine | 180 | 180 | 100.00 |
2 | Dove | IntenseRepair | 210 | 340 | 61.76 |
3 | Pantene | HairFallControl | 160 | 180 | 88.89 |
4 | Pantene | LivelyClean | 140 | 180 | 77.78 |
5 | HeadShoulders | AntiDandruff | 175 | 180 | 97.22 |
6 | HeadShoulders | CoolMenthol | 190 | 340 | 55.88 |
7 | ClinicPlus | StrongScalp | 130 | 180 | 72.22 |
8 | ClinicPlus | HealthCare | 150 | 340 | 44.12 |
9 | Sunsilk | BlackShine | 160 | 180 | 88.89 |
10 | Sunsilk | LusciouslyThick | 180 | 340 | 52.94 |
STEP 10: PLOT BAR CHART FOR TYPE DISTRIBUTION
proc sgplot data=indian_shampoos;
vbar Type / datalabel;
title "Bar Chart of Shampoo Types";
run;
Output:
- Get link
- X
- Other Apps
Comments
Post a Comment