245.SHAMPOO MARKET ANALYSIS IN INDIA USING PROC PRINT | PROC SORT | PROC FREQ | PROC MEANS | PROC SQL | MACROS | DATA DERIVATION | INSIGHTS GENERATION IN SAS

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:

ObsBrandVariantTypeGenderHerbalSulfateFreeFragrancePriceVolume_in_mlRating
1DoveDailyShineMoisturizingUnisexNoNoMild1801804.2
2DoveIntenseRepairRepairUnisexNoNoFloral2103404.5
3PanteneHairFallControlAntiHairFallFemaleNoNoFloral1601804.0
4PanteneLivelyCleanCleansingUnisexNoNoCitrus1401804.1
5HeadShouldersAntiDandruffAntiDandruffMaleNoNoMint1751804.3
6HeadShouldersCoolMentholAntiDandruffMaleNoNoMenthol1903404.6
7ClinicPlusStrongScalpNourishingFemaleNoNoHerbal1301804.0
8ClinicPlusHealthCareNourishingFemaleNoNoHerbal1503403.9
9SunsilkBlackShineShineFemaleNoNoFruity1601804.2
10SunsilkLusciouslyThickVolumeFemaleNoNoFloral1803404.3
11HimalayaAntiHairFallHerbalFemaleYesYesHerbal1402004.5
12HimalayaProteinNourishingUnisexYesYesHerbal1302004.4
13KhadiNeemAloeHerbalUnisexYesYesHerbal1802104.7
14KhadiShikakaiHerbalUnisexYesYesHerbal1702004.6
15BiotiqueBioKelpHerbalUnisexYesYesHerbal1902004.5
16BiotiqueGreenAppleOilyScalpUnisexYesYesFruity1602004.4
17WOWAppleCiderHerbalUnisexYesYesApple4993004.8
18WOWOnionBlackSeedHerbalUnisexYesYesOnion5993004.7
19MamaearthOnionHerbalUnisexYesYesOnion3492504.6
20MamaearthTeaTreeAntiDandruffUnisexYesYesTeaTree3292504.5
21TresemmeKeratinSmoothSmoothingFemaleNoNoFloral2203404.3
22TresemmeBotaniqueHerbalFemaleYesYesFloral2503404.4
23L'OrealTotalRepairRepairFemaleNoNoFloral2993404.4
24L'OrealFallResistAntiHairFallFemaleNoNoMild2793404.2
25NyleDamageRepairRepairUnisexYesYesHerbal1501804.1
26NyleAntiDandruffAntiDandruffUnisexYesYesHerbal1601804.2
27AyushAntiDandruffHerbalUnisexYesYesHerbal1201804.3
28AyushThickGrowthHerbalUnisexYesYesHerbal1301804.4
29VLCCProteinShampooNourishingUnisexYesYesMild1992004.1
30MeeraShikakaiHerbalFemaleYesYesHerbal1101804.2
31ParkAvenueBeerShampooAntiDandruffMaleNoYesBeer2253504.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

ObsBrandVariantTypeGenderHerbalSulfateFreeFragrancePriceVolume_in_mlRating
1DoveDailyShineMoisturizingUnisexNoNoMild1801804.2
2DoveIntenseRepairRepairUnisexNoNoFloral2103404.5
3PanteneHairFallControlAntiHairFallFemaleNoNoFloral1601804.0
4PanteneLivelyCleanCleansingUnisexNoNoCitrus1401804.1
5HeadShouldersAntiDandruffAntiDandruffMaleNoNoMint1751804.3
6HeadShouldersCoolMentholAntiDandruffMaleNoNoMenthol1903404.6
7ClinicPlusStrongScalpNourishingFemaleNoNoHerbal1301804.0
8ClinicPlusHealthCareNourishingFemaleNoNoHerbal1503403.9
9SunsilkBlackShineShineFemaleNoNoFruity1601804.2
10SunsilkLusciouslyThickVolumeFemaleNoNoFloral1803404.3
11HimalayaAntiHairFallHerbalFemaleYesYesHerbal1402004.5
12HimalayaProteinNourishingUnisexYesYesHerbal1302004.4
13KhadiNeemAloeHerbalUnisexYesYesHerbal1802104.7
14KhadiShikakaiHerbalUnisexYesYesHerbal1702004.6
15BiotiqueBioKelpHerbalUnisexYesYesHerbal1902004.5
16BiotiqueGreenAppleOilyScalpUnisexYesYesFruity1602004.4
17WOWAppleCiderHerbalUnisexYesYesApple4993004.8
18WOWOnionBlackSeedHerbalUnisexYesYesOnion5993004.7
19MamaearthOnionHerbalUnisexYesYesOnion3492504.6
20MamaearthTeaTreeAntiDandruffUnisexYesYesTeaTree3292504.5
21TresemmeKeratinSmoothSmoothingFemaleNoNoFloral2203404.3
22TresemmeBotaniqueHerbalFemaleYesYesFloral2503404.4
23L'OrealTotalRepairRepairFemaleNoNoFloral2993404.4
24L'OrealFallResistAntiHairFallFemaleNoNoMild2793404.2
25NyleDamageRepairRepairUnisexYesYesHerbal1501804.1
26NyleAntiDandruffAntiDandruffUnisexYesYesHerbal1601804.2
27AyushAntiDandruffHerbalUnisexYesYesHerbal1201804.3
28AyushThickGrowthHerbalUnisexYesYesHerbal1301804.4
29VLCCProteinShampooNourishingUnisexYesYesMild1992004.1
30MeeraShikakaiHerbalFemaleYesYesHerbal1101804.2
31ParkAvenueBeerShampooAntiDandruffMaleNoYesBeer2253504.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

ObsBrandVariantTypeGenderHerbalSulfateFreeFragrancePriceVolume_in_mlRating
1WOWOnionBlackSeedHerbalUnisexYesYesOnion5993004.7
2WOWAppleCiderHerbalUnisexYesYesApple4993004.8
3MamaearthOnionHerbalUnisexYesYesOnion3492504.6
4MamaearthTeaTreeAntiDandruffUnisexYesYesTeaTree3292504.5
5L'OrealTotalRepairRepairFemaleNoNoFloral2993404.4
6L'OrealFallResistAntiHairFallFemaleNoNoMild2793404.2
7TresemmeBotaniqueHerbalFemaleYesYesFloral2503404.4
8ParkAvenueBeerShampooAntiDandruffMaleNoYesBeer2253504.5
9TresemmeKeratinSmoothSmoothingFemaleNoNoFloral2203404.3
10DoveIntenseRepairRepairUnisexNoNoFloral2103404.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

TypeFrequencyPercentCumulative
Frequency
Cumulative
Percent
AntiDandruff516.13516.13
AntiHairFall26.45722.58
Cleansing13.23825.81
Herbal1135.481961.29
Moisturizing13.232064.52
Nourishing412.902477.42
OilyScalp13.232580.65
Repair39.682890.32
Shine13.232993.55
Smoothing13.233096.77
Volume13.2331100.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

HerbalFrequencyPercentCumulative
Frequency
Cumulative
Percent
No1445.161445.16
Yes1754.8431100.00
SulfateFreeFrequencyPercentCumulative
Frequency
Cumulative
Percent
No1341.941341.94
Yes1858.0631100.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

VariableNMeanMinimumMaximumStd 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:

BrandVariantPriceVolume_in_ml
HimalayaAntiHairFall140200
HimalayaProtein130200
KhadiNeemAloe180210
KhadiShikakai170200
BiotiqueBioKelp190200
BiotiqueGreenApple160200
WOWAppleCider499300
WOWOnionBlackSeed599300
MamaearthOnion349250
MamaearthTeaTree329250
TresemmeBotanique250340
NyleDamageRepair150180
NyleAntiDandruff160180
AyushAntiDandruff120180
AyushThickGrowth130180
VLCCProteinShampoo199200
MeeraShikakai110180

2. Top 5 Rated Shampoos

proc sql outobs=5;

    select Brand, Variant, Rating

    from indian_shampoos

    order by Rating desc;

quit;

Output:

BrandVariantRating
WOWAppleCider4.8
KhadiNeemAloe4.7
WOWOnionBlackSeed4.7
HeadShouldersCoolMenthol4.6
MamaearthOnion4.6

3. Average Price by Type

proc sql;

    select Type, avg(Price) as AvgPrice

    from indian_shampoos

    group by Type;

quit;

Output:

TypeAvgPrice
AntiDandruff215.8
AntiHairFall219.5
Cleansing140
Herbal248.8182
Moisturizing180
Nourishing152.25
OilyScalp160
Repair219.6667
Shine160
Smoothing220
Volume180

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

ObsBrandVariantTypeGenderHerbalSulfateFreeFragrancePriceVolume_in_mlRating
3PanteneHairFallControlAntiHairFallFemaleNoNoFloral1601804.0
7ClinicPlusStrongScalpNourishingFemaleNoNoHerbal1301804.0
8ClinicPlusHealthCareNourishingFemaleNoNoHerbal1503403.9
9SunsilkBlackShineShineFemaleNoNoFruity1601804.2
10SunsilkLusciouslyThickVolumeFemaleNoNoFloral1803404.3
11HimalayaAntiHairFallHerbalFemaleYesYesHerbal1402004.5
21TresemmeKeratinSmoothSmoothingFemaleNoNoFloral2203404.3
22TresemmeBotaniqueHerbalFemaleYesYesFloral2503404.4
23L'OrealTotalRepairRepairFemaleNoNoFloral2993404.4
24L'OrealFallResistAntiHairFallFemaleNoNoMild2793404.2
30MeeraShikakaiHerbalFemaleYesYesHerbal1101804.2

%filter_gender(Male);

Output:

Shampoos Targeted for Male Users

ObsBrandVariantTypeGenderHerbalSulfateFreeFragrancePriceVolume_in_mlRating
5HeadShouldersAntiDandruffAntiDandruffMaleNoNoMint1751804.3
6HeadShouldersCoolMentholAntiDandruffMaleNoNoMenthol1903404.6
31ParkAvenueBeerShampooAntiDandruffMaleNoYesBeer2253504.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:

BrandVariantPrice
DoveDailyShine180
PanteneHairFallControl160
PanteneLivelyClean140
HeadShouldersAntiDandruff175
HeadShouldersCoolMenthol190
ClinicPlusStrongScalp130
ClinicPlusHealthCare150
SunsilkBlackShine160
SunsilkLusciouslyThick180
HimalayaAntiHairFall140
HimalayaProtein130
KhadiNeemAloe180
KhadiShikakai170
BiotiqueBioKelp190
BiotiqueGreenApple160
NyleDamageRepair150
NyleAntiDandruff160
AyushAntiDandruff120
AyushThickGrowth130
VLCCProteinShampoo199
MeeraShikakai110

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

ObsBrandVariantPriceVolume_in_mlPricePer100ml
1DoveDailyShine180180100.00
2DoveIntenseRepair21034061.76
3PanteneHairFallControl16018088.89
4PanteneLivelyClean14018077.78
5HeadShouldersAntiDandruff17518097.22
6HeadShouldersCoolMenthol19034055.88
7ClinicPlusStrongScalp13018072.22
8ClinicPlusHealthCare15034044.12
9SunsilkBlackShine16018088.89
10SunsilkLusciouslyThick18034052.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:









To Visit My Previous Proc  Means And Nway Option:Click Here
To Visit My Previous Proc Means And CharType Option:Click Here
To Visit My Previous SAS Functions:Click Here
To Visit My Previous Length Statement Using In Many Ways:Click Here





--->PLEASE FOLLOW OUR BLOG FOR MORE INFORMATION.
--->PLEASE DO COMMENTS AND SHARE OUR BLOG.

PLEASE FOLLOW OUR TELEGRAM CHANNEL CLICK HERE

PLEASE FOLLOW OUR FACEBOOK PAGE  CLICK HERE

PLEASE FOLLOW OUR INSTAGRAM PAGE CLICK HERE



Comments