Friday, 19 December 2025

344.MOVIE INDUSTRY DATA ANALYSIS USING SAS | PROFITABILITY INSIGHTS | STATISTICAL EVALUATION | VISUAL ANALYTICS | PROC SQL | PROC MEANS | PROC CORR | PROC UNIVARIATE | PROC SGPLOT | MACROS | DATE FUNCTIONS

MOVIE INDUSTRY DATA ANALYSIS USING SAS | PROFITABILITY INSIGHTS | STATISTICAL EVALUATION | VISUAL ANALYTICS | PROC SQL | PROC MEANS | PROC CORR | PROC UNIVARIATE | PROC SGPLOT | MACROS | DATE FUNCTIONS

options nocenter;

1.MOVIE DATASET CREATION

data movies;

    length Movie_Name $25 Genre $15;

    format Release_Date date9.;

    input Movie_Name $ Genre $ Budget Revenue IMDb_Rating Release_Date :date9.;

    Year = year(Release_Date);

    datalines;

Inception SciFi 160 829 8.8 16JUL2010

Titanic Romance 200 2200 7.9 19DEC1997

Avatar SciFi 237 2920 7.8 18DEC2009

Joker Drama 55 1074 8.4 04OCT2019

Interstellar SciFi 165 677 8.6 07NOV2014

Gladiator Action 103 460 8.5 05MAY2000

Matrix SciFi 63 466 8.7 31MAR1999

Frozen Animation 150 1280 7.4 27NOV2013

Avengers Action 220 1519 8.0 04MAY2012

Parasite Thriller 11 258 8.6 30MAY2019

Dangal Sports 70 300 8.4 23DEC2016

RRR Action 72 160 8.0 25MAR2022

;

run;

proc print data=movies;

run;

OUTPUT:

ObsMovie_NameGenreRelease_DateBudgetRevenueIMDb_RatingYear
1InceptionSciFi16JUL20101608298.82010
2TitanicRomance19DEC199720022007.91997
3AvatarSciFi18DEC200923729207.82009
4JokerDrama04OCT20195510748.42019
5InterstellarSciFi07NOV20141656778.62014
6GladiatorAction05MAY20001034608.52000
7MatrixSciFi31MAR1999634668.71999
8FrozenAnimation27NOV201315012807.42013
9AvengersAction04MAY201222015198.02012
10ParasiteThriller30MAY2019112588.62019
11DangalSports23DEC2016703008.42016
12RRRAction25MAR2022721608.02022

2.PROFIT CALCULATION USING PROC SQL

proc sql;

    create table movie_profit as

    select *,

           (Revenue - Budget) as Profit format=comma10.

    from movies;

quit;

proc print data=movie_profit;

run;

OUTPUT:

ObsMovie_NameGenreRelease_DateBudgetRevenueIMDb_RatingYearProfit
1InceptionSciFi16JUL20101608298.82010669
2TitanicRomance19DEC199720022007.919972,000
3AvatarSciFi18DEC200923729207.820092,683
4JokerDrama04OCT20195510748.420191,019
5InterstellarSciFi07NOV20141656778.62014512
6GladiatorAction05MAY20001034608.52000357
7MatrixSciFi31MAR1999634668.71999403
8FrozenAnimation27NOV201315012807.420131,130
9AvengersAction04MAY201222015198.020121,299
10ParasiteThriller30MAY2019112588.62019247
11DangalSports23DEC2016703008.42016230
12RRRAction25MAR2022721608.0202288


3.DATE ANALYSIS USING INTNX AND INTCK

data movie_dates;

    set movie_profit;

    Years_Since_Release = intck('year', Release_Date, today());

    Next_Anniversary = intnx('year', Release_Date, Years_Since_Release + 1, 'same');

    format Next_Anniversary date9.;

run;

proc print data=movie_dates;

run;

OUTPUT:

ObsMovie_NameGenreRelease_DateBudgetRevenueIMDb_RatingYearProfitYears_Since_ReleaseNext_Anniversary
1InceptionSciFi16JUL20101608298.820106691516JUL2026
2TitanicRomance19DEC199720022007.919972,0002819DEC2026
3AvatarSciFi18DEC200923729207.820092,6831618DEC2026
4JokerDrama04OCT20195510748.420191,019604OCT2026
5InterstellarSciFi07NOV20141656778.620145121107NOV2026
6GladiatorAction05MAY20001034608.520003572505MAY2026
7MatrixSciFi31MAR1999634668.719994032631MAR2026
8FrozenAnimation27NOV201315012807.420131,1301227NOV2026
9AvengersAction04MAY201222015198.020121,2991304MAY2026
10ParasiteThriller30MAY2019112588.62019247630MAY2026
11DangalSports23DEC2016703008.42016230923DEC2026
12RRRAction25MAR2022721608.0202288325MAR2026


4.MACRO FOR PROFIT CLASSIFICATION

%macro profit_flag(ds=, out=);

data &out;

    set &ds;

    length Profit_Category $15;

    if Profit >= 500 then Profit_Category = 'BLOCKBUSTER';

    else if Profit >= 100 then Profit_Category = 'HIT';

    else if Profit > 0 then Profit_Category = 'AVERAGE';

    else Profit_Category = 'FLOP';

run;

proc print data=&out;

run;

%mend;


%profit_flag(ds=movie_profit, out=movie_analysis);

OUTPUT:

ObsMovie_NameGenreRelease_DateBudgetRevenueIMDb_RatingYearProfitProfit_Category
1InceptionSciFi16JUL20101608298.82010669BLOCKBUSTER
2TitanicRomance19DEC199720022007.919972,000BLOCKBUSTER
3AvatarSciFi18DEC200923729207.820092,683BLOCKBUSTER
4JokerDrama04OCT20195510748.420191,019BLOCKBUSTER
5InterstellarSciFi07NOV20141656778.62014512BLOCKBUSTER
6GladiatorAction05MAY20001034608.52000357HIT
7MatrixSciFi31MAR1999634668.71999403HIT
8FrozenAnimation27NOV201315012807.420131,130BLOCKBUSTER
9AvengersAction04MAY201222015198.020121,299BLOCKBUSTER
10ParasiteThriller30MAY2019112588.62019247HIT
11DangalSports23DEC2016703008.42016230HIT
12RRRAction25MAR2022721608.0202288AVERAGE


5.DESCRIPTIVE STATISTICS USING PROC MEANS

proc means data=movie_analysis mean min max;

    var Budget Revenue Profit IMDb_Rating;

    title "SUMMARY STATISTICS OF MOVIE FINANCIALS";

run;

OUTPUT:

SUMMARY STATISTICS OF MOVIE FINANCIALS

The MEANS Procedure

VariableMeanMinimumMaximum
Budget
Revenue
Profit
IMDb_Rating
125.5000000
1011.92
886.4166667
8.2583333
11.0000000
160.0000000
88.0000000
7.4000000
237.0000000
2920.00
2683.00
8.8000000

6.CORRELATION ANALYSIS USING PROC CORR

proc corr data=movie_analysis;

    var Budget Revenue IMDb_Rating Profit;

    title "CORRELATION ANALYSIS OF MOVIE VARIABLES";

run;

OUTPUT:

CORRELATION ANALYSIS OF MOVIE VARIABLES

The CORR Procedure

4 Variables:Budget Revenue IMDb_Rating Profit
Simple Statistics
VariableNMeanStd DevSumMinimumMaximum
Budget12125.5000073.04980150611.00000237.00000
Revenue121012849.3004012143160.000002920
IMDb_Rating128.258330.4295099.100007.400008.80000
Profit12886.41667791.635411063788.000002683
Pearson Correlation Coefficients, N = 12
Prob > |r| under H0: Rho=0
 BudgetRevenueIMDb_RatingProfit
Budget
1.00000
 
0.80560
0.0016
-0.48461
0.1103
0.77201
0.0033
Revenue
0.80560
0.0016
1.00000
 
-0.59288
0.0422
0.99850
<.0001
IMDb_Rating
-0.48461
0.1103
-0.59288
0.0422
1.00000
 
-0.59135
0.0429
Profit
0.77201
0.0033
0.99850
<.0001
-0.59135
0.0429
1.00000
 

7.DISTRIBUTION ANALYSIS USING PROC UNIVARIATE

proc univariate data=movie_analysis;

    var Profit;

    histogram Profit;

    inset mean median std skewness;

    title "PROFIT DISTRIBUTION ANALYSIS";

run;

OUTPUT:

PROFIT DISTRIBUTION ANALYSIS

The UNIVARIATE Procedure

Variable: Profit

Moments
N12Sum Weights12
Mean886.416667Sum Observations10637
Std Deviation791.635414Variance626686.629
Skewness1.2950494Kurtosis1.14365626
Uncorrected SS16322367Corrected SS6893552.92
Coeff Variation89.3073702Std Error Mean228.52546
Basic Statistical Measures
LocationVariability
Mean886.4167Std Deviation791.63541
Median590.5000Variance626687
Mode.Range2595
  Interquartile Range912.50000
Tests for Location: Mu0=0
TestStatisticp Value
Student's tt3.878853Pr > |t|0.0026
SignM6Pr >= |M|0.0005
Signed RankS39Pr >= |S|0.0005
Quantiles (Definition 5)
LevelQuantile
100% Max2683.0
99%2683.0
95%2683.0
90%2000.0
75% Q31214.5
50% Median590.5
25% Q1302.0
10%230.0
5%88.0
1%88.0
0% Min88.0
Extreme Observations
LowestHighest
ValueObsValueObs
881210194
2301111308
2471012999
357620002
403726833

PROFIT DISTRIBUTION ANALYSIS

The UNIVARIATE Procedure

Histogram for Profit

8.DATA VISUALIZATION USING PROC SGPLOT

A. Revenue vs Budget

proc sgplot data=movie_analysis;

    scatter x=Budget y=Revenue / datalabel=Movie_Name;

    title "BUDGET VS REVENUE SCATTER PLOT";

run;

OUTPUT:

The SGPlot Procedure


B. Profit by Genre

proc sgplot data=movie_analysis;

    vbar Genre / response=Profit stat=mean;

    title "AVERAGE PROFIT BY GENRE";

run;

OUTPUT:

The SGPlot Procedure


9.PROC FREQ

Genre Distribution

proc freq data=movie_analysis;

    tables Genre*Profit_Category;

    title "GENRE AND PROFIT CATEGORY DISTRIBUTION";

run;

OUTPUT:

GENRE AND PROFIT CATEGORY DISTRIBUTION

The FREQ Procedure

Frequency
Percent
Row Pct
Col Pct
Table of Genre by Profit_Category
GenreProfit_Category
AVERAGEBLOCKBUSTERHITTotal
Action
1
8.33
33.33
100.00
1
8.33
33.33
14.29
1
8.33
33.33
25.00
3
25.00
 
 
Animation
0
0.00
0.00
0.00
1
8.33
100.00
14.29
0
0.00
0.00
0.00
1
8.33
 
 
Drama
0
0.00
0.00
0.00
1
8.33
100.00
14.29
0
0.00
0.00
0.00
1
8.33
 
 
Romance
0
0.00
0.00
0.00
1
8.33
100.00
14.29
0
0.00
0.00
0.00
1
8.33
 
 
SciFi
0
0.00
0.00
0.00
3
25.00
75.00
42.86
1
8.33
25.00
25.00
4
33.33
 
 
Sports
0
0.00
0.00
0.00
0
0.00
0.00
0.00
1
8.33
100.00
25.00
1
8.33
 
 
Thriller
0
0.00
0.00
0.00
0
0.00
0.00
0.00
1
8.33
100.00
25.00
1
8.33
 
 
Total
1
8.33
7
58.33
4
33.33
12
100.00

10.PROC: PROC RANK

Ranking Movies by Profit

proc rank data=movie_analysis out=movie_rank descending;

    var Profit;

    ranks Profit_Rank;

run;

proc print data=movie_rank;

run;

OUTPUT:

ObsMovie_NameGenreRelease_DateBudgetRevenueIMDb_RatingYearProfitProfit_CategoryProfit_Rank
1InceptionSciFi16JUL20101608298.82010669BLOCKBUSTER6
2TitanicRomance19DEC199720022007.919972,000BLOCKBUSTER2
3AvatarSciFi18DEC200923729207.820092,683BLOCKBUSTER1
4JokerDrama04OCT20195510748.420191,019BLOCKBUSTER5
5InterstellarSciFi07NOV20141656778.62014512BLOCKBUSTER7
6GladiatorAction05MAY20001034608.52000357HIT9
7MatrixSciFi31MAR1999634668.71999403HIT8
8FrozenAnimation27NOV201315012807.420131,130BLOCKBUSTER4
9AvengersAction04MAY201222015198.020121,299BLOCKBUSTER3
10ParasiteThriller30MAY2019112588.62019247HIT10
11DangalSports23DEC2016703008.42016230HIT11
12RRRAction25MAR2022721608.0202288AVERAGE12


YESTERDAY INVALID CODE ANSWER

10.PIE Chart

proc sgplot data=olympic_efficiency;

    pie Efficiency_Level / datalabel;

run;

/* Note: In practice above there is an Invalid in this code Find it,Correct it and Use it /*

CORRECT ANSWER

proc gchart data=olympic_efficiency;

    pie Efficiency_Level;

run;

quit;


To Visit My Previous Online Streaming Flatform Dataset:Click Here
To Visit My Previous Statistical Evaluation Of Clinical Trials:Click Here
To Visit My Previous Unlocking Retail Insights Dataset:Click Here
To Visit My Previous Sas Interview Questions-1:Click Here  



Follow Us On : 


 


--- FOLLOW OUR BLOG FOR MORE INFORMATION.

--->PLEASE DO COMMENTS AND SHARE OUR BLOG.

No comments:

Post a Comment