253.REAL-WORLD TAXES IN INDIA ANALYSIS USING PROC PRINT | PROC SORT | PROC MEANS | PROC FREQ | PROC TRANSPOSE | PROC SQL | MACROS IN SAS

REAL-WORLD TAXES IN INDIA ANALYSIS USING PROC PRINT | PROC SORT | PROC MEANS | PROC FREQ | PROC TRANSPOSE | PROC SQL | MACROS IN SAS


/*Creating a real-world style dataset for different types of taxes in India*/

STEP 1: CREATE THE REAL-WORLD TAXES DATASET FOR INDIA

options nocenter;

data taxes_india;

    length Tax_Type $30 Category $10 Applicable_To $20 State $20 Notes $100;

    infile datalines dsd dlm=' ';

    input Tax_ID

          Tax_Type :$30.

          Category :$10.

          Applicable_To :$20.

          State :$20.

          Rate_Percent

          Year

          Revenue_Collected_Cr

          Notes :& $100.;

    datalines;

1 Income_Tax Direct Individual All_India 5 2024 750000 "5% slab up to 5 lakh"

2 Income_Tax Direct Individual All_India 20 2024 1250000 "20% slab 5-10 lakh"

3 Income_Tax Direct Individual All_India 30 2024 2200000 "Above 10 lakh"

4 Corporate_Tax Direct Company All_India 25 2024 1500000 "Domestic companies turnover<400cr"

5 Corporate_Tax Direct Company All_India 30 2024 1800000 "Other companies"

6 CGST Indirect Both All_India 9 2024 3200000 "Central GST component"

7 SGST Indirect Both Karnataka 9 2024 1800000 "State GST Karnataka"

8 SGST Indirect Both Maharashtra 9 2024 2200000 "State GST Maharashtra"

9 IGST Indirect Both All_India 18 2024 4500000 "Interstate GST"

10 Property_Tax Direct Both Delhi 1 2024 50000 "Municipal property tax"

11 Property_Tax Direct Both Mumbai 1 2024 70000 "Municipal property tax"

12 Road_Tax Direct Both Telangana 8 2024 90000 "Vehicle lifetime tax"

13 Road_Tax Direct Both TamilNadu 10 2024 85000 "Vehicle lifetime tax"

14 Professional_Tax Direct Individual Maharashtra 2500 2024 45000 "Annual profession tax"

15 Professional_Tax Direct Individual Karnataka 2400 2024 35000 "Annual profession tax"

16 Capital_Gains_Tax Direct Individual All_India 10 2024 600000 "Long-term capital gains"

17 Capital_Gains_Tax Direct Individual All_India 15 2024 400000 "Short-term capital gains"

18 Customs_Duty Indirect Both All_India 10 2024 800000 "Imports"

19 Excise_Duty Indirect Both All_India 12 2024 500000 "Petroleum, tobacco"

20 Stamp_Duty Direct Both Telangana 6 2024 70000 "Property registration"

21 Stamp_Duty Direct Both Maharashtra 5 2024 95000 "Property registration"

22 TDS Direct Both All_India 10 2024 200000 "Tax deducted at source"

23 Service_Tax Indirect Both All_India 15 2016 1200000 "Pre-GST era"

24 Wealth_Tax Direct Individual All_India 1 2015 50000 "Abolished post 2015"

25 Entertainment_Tax Indirect Both Delhi 15 2016 75000 "Pre-GST era"

26 Luxury_Tax Indirect Both Goa 10 2016 65000 "Hotels, luxury items pre-GST"

27 GST_Compensation_Cess Indirect Both All_India 12 2024 400000 "Luxury and sin goods"

;

run;

proc print;run;

Output:

ObsTax_TypeCategoryApplicable_ToStateNotesTax_IDRate_PercentYearRevenue_Collected_Cr
1Income_TaxDirectIndividualAll_India5% slab up to 5 lakh152024750000
2Income_TaxDirectIndividualAll_India20% slab 5-10 lakh22020241250000
3Income_TaxDirectIndividualAll_IndiaAbove 10 lakh33020242200000
4Corporate_TaxDirectCompanyAll_IndiaDomestic companies turnover<400cr42520241500000
5Corporate_TaxDirectCompanyAll_IndiaOther companies53020241800000
6CGSTIndirectBothAll_IndiaCentral GST component6920243200000
7SGSTIndirectBothKarnatakaState GST Karnataka7920241800000
8SGSTIndirectBothMaharashtraState GST Maharashtra8920242200000
9IGSTIndirectBothAll_IndiaInterstate GST91820244500000
10Property_TaxDirectBothDelhiMunicipal property tax101202450000
11Property_TaxDirectBothMumbaiMunicipal property tax111202470000
12Road_TaxDirectBothTelanganaVehicle lifetime tax128202490000
13Road_TaxDirectBothTamilNaduVehicle lifetime tax1310202485000
14Professional_TaxDirectIndividualMaharashtraAnnual profession tax142500202445000
15Professional_TaxDirectIndividualKarnatakaAnnual profession tax152400202435000
16Capital_Gains_TaxDirectIndividualAll_IndiaLong-term capital gains16102024600000
17Capital_Gains_TaxDirectIndividualAll_IndiaShort-term capital gains17152024400000
18Customs_DutyIndirectBothAll_IndiaImports18102024800000
19Excise_DutyIndirectBothAll_IndiaPetroleum, tobacco19122024500000
20Stamp_DutyDirectBothTelanganaProperty registration206202470000
21Stamp_DutyDirectBothMaharashtraProperty registration215202495000
22TDSDirectBothAll_IndiaTax deducted at source22102024200000
23Service_TaxIndirectBothAll_IndiaPre-GST era231520161200000
24Wealth_TaxDirectIndividualAll_IndiaAbolished post 2015241201550000
25Entertainment_TaxIndirectBothDelhiPre-GST era2515201675000
26Luxury_TaxIndirectBothGoaHotels, luxury items pre-GST2610201665000
27GST_Compensation_CessIndirectBothAll_IndiaLuxury and sin goods27122024400000


STEP 2: Display the created dataset

proc print data=taxes_india (obs=15);

    title "REAL-WORLD TAXES DATASET IN INDIA";

run;

Output:

REAL-WORLD TAXES DATASET IN INDIA

ObsTax_TypeCategoryApplicable_ToStateNotesTax_IDRate_PercentYearRevenue_Collected_Cr
1Income_TaxDirectIndividualAll_India5% slab up to 5 lakh152024750000
2Income_TaxDirectIndividualAll_India20% slab 5-10 lakh22020241250000
3Income_TaxDirectIndividualAll_IndiaAbove 10 lakh33020242200000
4Corporate_TaxDirectCompanyAll_IndiaDomestic companies turnover<400cr42520241500000
5Corporate_TaxDirectCompanyAll_IndiaOther companies53020241800000
6CGSTIndirectBothAll_IndiaCentral GST component6920243200000
7SGSTIndirectBothKarnatakaState GST Karnataka7920241800000
8SGSTIndirectBothMaharashtraState GST Maharashtra8920242200000
9IGSTIndirectBothAll_IndiaInterstate GST91820244500000
10Property_TaxDirectBothDelhiMunicipal property tax101202450000
11Property_TaxDirectBothMumbaiMunicipal property tax111202470000
12Road_TaxDirectBothTelanganaVehicle lifetime tax128202490000
13Road_TaxDirectBothTamilNaduVehicle lifetime tax1310202485000
14Professional_TaxDirectIndividualMaharashtraAnnual profession tax142500202445000
15Professional_TaxDirectIndividualKarnatakaAnnual profession tax152400202435000

STEP 3: SORT THE DATA BY REVENUE COLLECTION

proc sort data=taxes_india out=taxes_sorted;

    by descending Revenue_Collected_Cr;

run;

proc print data=taxes_sorted;

    title "Taxes in India Sorted by Revenue Collection";

run;

Output:

Taxes in India Sorted by Revenue Collection

ObsTax_TypeCategoryApplicable_ToStateNotesTax_IDRate_PercentYearRevenue_Collected_Cr
1IGSTIndirectBothAll_IndiaInterstate GST91820244500000
2CGSTIndirectBothAll_IndiaCentral GST component6920243200000
3Income_TaxDirectIndividualAll_IndiaAbove 10 lakh33020242200000
4SGSTIndirectBothMaharashtraState GST Maharashtra8920242200000
5Corporate_TaxDirectCompanyAll_IndiaOther companies53020241800000
6SGSTIndirectBothKarnatakaState GST Karnataka7920241800000
7Corporate_TaxDirectCompanyAll_IndiaDomestic companies turnover<400cr42520241500000
8Income_TaxDirectIndividualAll_India20% slab 5-10 lakh22020241250000
9Service_TaxIndirectBothAll_IndiaPre-GST era231520161200000
10Customs_DutyIndirectBothAll_IndiaImports18102024800000
11Income_TaxDirectIndividualAll_India5% slab up to 5 lakh152024750000
12Capital_Gains_TaxDirectIndividualAll_IndiaLong-term capital gains16102024600000
13Excise_DutyIndirectBothAll_IndiaPetroleum, tobacco19122024500000
14Capital_Gains_TaxDirectIndividualAll_IndiaShort-term capital gains17152024400000
15GST_Compensation_CessIndirectBothAll_IndiaLuxury and sin goods27122024400000
16TDSDirectBothAll_IndiaTax deducted at source22102024200000
17Stamp_DutyDirectBothMaharashtraProperty registration215202495000
18Road_TaxDirectBothTelanganaVehicle lifetime tax128202490000
19Road_TaxDirectBothTamilNaduVehicle lifetime tax1310202485000
20Entertainment_TaxIndirectBothDelhiPre-GST era2515201675000
21Property_TaxDirectBothMumbaiMunicipal property tax111202470000
22Stamp_DutyDirectBothTelanganaProperty registration206202470000
23Luxury_TaxIndirectBothGoaHotels, luxury items pre-GST2610201665000
24Property_TaxDirectBothDelhiMunicipal property tax101202450000
25Wealth_TaxDirectIndividualAll_IndiaAbolished post 2015241201550000
26Professional_TaxDirectIndividualMaharashtraAnnual profession tax142500202445000
27Professional_TaxDirectIndividualKarnatakaAnnual profession tax152400202435000

STEP 4: SUMMARY STATISTICS USING PROC MEANS

proc means data=taxes_india mean min max sum;

    var Rate_Percent Revenue_Collected_Cr;

    class Category;

    title "Summary Statistics of Tax Rates and Revenue by Category";

run;

Output:

Summary Statistics of Tax Rates and Revenue by Category

The MEANS Procedure

CategoryN ObsVariableMeanMinimumMaximumSum
Direct17
Rate_Percent
Revenue_Collected_Cr
298.6470588
546470.59
1.0000000
35000.00
2500.00
2200000.00
5077.00
9290000.00
Indirect10
Rate_Percent
Revenue_Collected_Cr
11.9000000
1474000.00
9.0000000
65000.00
18.0000000
4500000.00
119.0000000
14740000.00

STEP 5: FREQUENCY DISTRIBUTION OF TAX TYPES AND STATES

proc freq data=taxes_india;

    tables Category Applicable_To State;

    title "Frequency Distribution of Taxes by Category, Payer Type, and State";

run;

Output:

Frequency Distribution of Taxes by Category, Payer Type, and State

The FREQ Procedure

CategoryFrequencyPercentCumulative
Frequency
Cumulative
Percent
Direct1762.961762.96
Indirect1037.0427100.00
Applicable_ToFrequencyPercentCumulative
Frequency
Cumulative
Percent
Both1762.961762.96
Company27.411970.37
Individual829.6327100.00
StateFrequencyPercentCumulative
Frequency
Cumulative
Percent
All_India1555.561555.56
Delhi27.411762.96
Goa13.701866.67
Karnataka27.412074.07
Maharashtra311.112385.19
Mumbai13.702488.89
TamilNadu13.702592.59
Telangana27.4127100.00

STEP 6: TRANSPOSE FOR YEAR-WISE REVENUE COMPARISON

proc sort data=taxes_india out=taxes_sorted;

    by Tax_Type Year;

run;


proc sql;

    create table taxes_summary as

    select Tax_Type, Year, sum(Revenue_Collected_Cr) as Revenue_Collected_Cr

    from taxes_sorted

    group by Tax_Type, Year;

quit;


proc transpose data=taxes_summary out=taxes_transposed prefix=Year_;

    by Tax_Type;

    id Year;

    var Revenue_Collected_Cr;

run;


proc print data=taxes_transposed;

    title "Year-wise Revenue Collection for Each Tax Type (Summarized)";

run;

Output:

Year-wise Revenue Collection for Each Tax Type (Summarized)

ObsTax_Type_NAME_Year_2024Year_2016Year_2015
1CGSTRevenue_Collected_Cr3200000..
2Capital_Gains_TaxRevenue_Collected_Cr1000000..
3Corporate_TaxRevenue_Collected_Cr3300000..
4Customs_DutyRevenue_Collected_Cr800000..
5Entertainment_TaxRevenue_Collected_Cr.75000.
6Excise_DutyRevenue_Collected_Cr500000..
7GST_Compensation_CessRevenue_Collected_Cr400000..
8IGSTRevenue_Collected_Cr4500000..
9Income_TaxRevenue_Collected_Cr4200000..
10Luxury_TaxRevenue_Collected_Cr.65000.
11Professional_TaxRevenue_Collected_Cr80000..
12Property_TaxRevenue_Collected_Cr120000..
13Road_TaxRevenue_Collected_Cr175000..
14SGSTRevenue_Collected_Cr4000000..
15Service_TaxRevenue_Collected_Cr.1200000.
16Stamp_DutyRevenue_Collected_Cr165000..
17TDSRevenue_Collected_Cr200000..
18Wealth_TaxRevenue_Collected_Cr..50000

STEP 7: SQL QUERIES FOR SPECIFIC ANALYSIS

7.1 Top 5 taxes by revenue 

proc sql outobs=5;

    create table top5_revenue as

    select Tax_Type, sum(Revenue_Collected_Cr) as Total_Revenue

    from taxes_india

    group by Tax_Type

    order by Total_Revenue desc;

quit;


proc print data=top5_revenue;

    title "Top 5 Taxes by Total Revenue";

run;

Output:

Top 5 Taxes by Total Revenue

ObsTax_TypeTotal_Revenue
1IGST4500000
2Income_Tax4200000
3SGST4000000
4Corporate_Tax3300000
5CGST3200000

7.2 Average tax rate for each category 

proc sql;

    select Category, avg(Rate_Percent) as Avg_Rate

    from taxes_india

    group by Category;

quit;

Output:

CategoryAvg_Rate
Direct298.6471
Indirect11.9

STEP 8: MACRO FOR AUTOMATED YEAR ANALYSIS

%macro tax_analysis(year);

    title "Tax Analysis for Year &year";

    proc sql;

        select Tax_Type, Category, State, Rate_Percent, Revenue_Collected_Cr

        from taxes_india

        where Year = &year

        order by Revenue_Collected_Cr desc;

    quit;


    proc means data=taxes_india;

        where Year = &year;

        var Revenue_Collected_Cr;

        title "Summary of Revenue for Year &year";

    run;

%mend;


%tax_analysis(2024);

Output:

Tax Analysis for Year 2024

Tax_TypeCategoryStateRate_PercentRevenue_Collected_Cr
IGSTIndirectAll_India184500000
CGSTIndirectAll_India93200000
Income_TaxDirectAll_India302200000
SGSTIndirectMaharashtra92200000
Corporate_TaxDirectAll_India301800000
SGSTIndirectKarnataka91800000
Corporate_TaxDirectAll_India251500000
Income_TaxDirectAll_India201250000
Customs_DutyIndirectAll_India10800000
Income_TaxDirectAll_India5750000
Capital_Gains_TaxDirectAll_India10600000
Excise_DutyIndirectAll_India12500000
GST_Compensation_CessIndirectAll_India12400000
Capital_Gains_TaxDirectAll_India15400000
TDSDirectAll_India10200000
Stamp_DutyDirectMaharashtra595000
Road_TaxDirectTelangana890000
Road_TaxDirectTamilNadu1085000
Property_TaxDirectMumbai170000
Stamp_DutyDirectTelangana670000
Property_TaxDirectDelhi150000
Professional_TaxDirectMaharashtra250045000
Professional_TaxDirectKarnataka240035000

Summary of Revenue for Year 2024

The MEANS Procedure

Analysis Variable : Revenue_Collected_Cr
NMeanStd DevMinimumMaximum
23984347.831175300.0635000.004500000.00

%tax_analysis(2016);

Output:

Tax Analysis for Year 2016

Tax_TypeCategoryStateRate_PercentRevenue_Collected_Cr
Service_TaxIndirectAll_India151200000
Entertainment_TaxIndirectDelhi1575000
Luxury_TaxIndirectGoa1065000

Summary of Revenue for Year 2016

The MEANS Procedure

Analysis Variable : Revenue_Collected_Cr
NMeanStd DevMinimumMaximum
3446666.67652424.9665000.001200000.00



To Visit My Previous Sas Questions Datasets:Click Here
To Visit My Previous Home Energy Consumption Dataset:Click Here
To Visit My Previous Wildlife Migration Dataset:Click Here
To Visit My Previous Endangered Species Dataset:Click Here





-->PRACTICE AND COMMENT YOUR OUTPUT: 
--->PLEASE FOLLOW OUR BLOG FOR MORE UPDATES.

PLEASE FOLLOW OUR TELEGRAM CHANNEL CLICK HERE

PLEASE FOLLOW OUR FACEBOOK PAGE  CLICK HERE

PLEASE FOLLOW OUR INSTAGRAM PAGE CLICK HERE

Comments

Popular posts from this blog

409.Can We Build a Reliable Emergency Services Analytics & Fraud Detection System in SAS While Identifying and Fixing Intentional Errors?

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

401.How Efficient Are Global Data Centers? A Complete SAS Analytics Study