357.Why is Your 5G Sometimes Slower Than 4G? Uncovering Mobile Performance Secrets with SAS

Why is Your 5G Sometimes Slower Than 4G? Uncovering Mobile Performance Secrets with SAS

 options nocenter;

1.DATASET CREATION WITH DATE FORMATS

data mobile_networks;

    length Generation $3 Coverage $10 Country $15;

    format Launch_Date date9.;

    input Generation $ Speed_Mbps Latency_ms Coverage $ Country $ Launch_Date :date9.;

    datalines;

2G 0.1 500 High India 01JAN1995

2G 0.2 480 High USA 01JAN1994

3G 2 200 Medium India 01JAN2004

3G 3 180 Medium UK 01JAN2003

4G 50 60 High India 01JAN2012

4G 70 50 High USA 01JAN2011

4G 100 45 Ultra SouthKorea 01JAN2010

5G 300 20 Medium India 01JAN2020

5G 500 15 High USA 01JAN2019

5G 800 10 Ultra China 01JAN2019

6G 1000 5 Low Japan 01JAN2030

6G 1200 3 Low SouthKorea 01JAN2030

6G 1500 1 Low USA 01JAN2031

;

run;

proc print data=mobile_networks;

run;

OUTPUT:

ObsGenerationCoverageCountryLaunch_DateSpeed_MbpsLatency_ms
12GHighIndia01JAN19950.1500
22GHighUSA01JAN19940.2480
33GMediumIndia01JAN20042.0200
43GMediumUK01JAN20033.0180
54GHighIndia01JAN201250.060
64GHighUSA01JAN201170.050
74GUltraSouthKorea01JAN2010100.045
85GMediumIndia01JAN2020300.020
95GHighUSA01JAN2019500.015
105GUltraChina01JAN2019800.010
116GLowJapan01JAN20301000.05
126GLowSouthKorea01JAN20301200.03
136GLowUSA01JAN20311500.01


2.DATE DERIVATIONS USING MDY, INTCK, INTNX

2.1 Years Since Launch

data mobile_dates;

    set mobile_networks;

    Years_Since_Launch = intck('year', Launch_Date, today());

    Next_Upgrade = intnx('year', Launch_Date, 10, 'same');

    format Next_Upgrade date9.;

run;

proc print data=mobile_dates;

run;

OUTPUT:

ObsGenerationCoverageCountryLaunch_DateSpeed_MbpsLatency_msYears_Since_LaunchNext_Upgrade
12GHighIndia01JAN19950.15003101JAN2005
22GHighUSA01JAN19940.24803201JAN2004
33GMediumIndia01JAN20042.02002201JAN2014
43GMediumUK01JAN20033.01802301JAN2013
54GHighIndia01JAN201250.0601401JAN2022
64GHighUSA01JAN201170.0501501JAN2021
74GUltraSouthKorea01JAN2010100.0451601JAN2020
85GMediumIndia01JAN2020300.020601JAN2030
95GHighUSA01JAN2019500.015701JAN2029
105GUltraChina01JAN2019800.010701JAN2029
116GLowJapan01JAN20301000.05-401JAN2040
126GLowSouthKorea01JAN20301200.03-401JAN2040
136GLowUSA01JAN20311500.01-501JAN2041


3.SPEED TIER CLASSIFICATION USING MACROS

%macro speed_tier;

data mobile_tiered;

    length Speed_Tier $10.;

    set mobile_dates;

    if Speed_Mbps < 1 then Speed_Tier = "Very Low";

    else if Speed_Mbps < 10 then Speed_Tier = "Low";

    else if Speed_Mbps < 100 then Speed_Tier = "Medium";

    else if Speed_Mbps < 500 then Speed_Tier = "High";

    else Speed_Tier = "Ultra High";

run;

proc print data=mobile_tiered;

run;

%mend speed_tier;


%speed_tier;

OUTPUT:

ObsSpeed_TierGenerationCoverageCountryLaunch_DateSpeed_MbpsLatency_msYears_Since_LaunchNext_Upgrade
1Very Low2GHighIndia01JAN19950.15003101JAN2005
2Very Low2GHighUSA01JAN19940.24803201JAN2004
3Low3GMediumIndia01JAN20042.02002201JAN2014
4Low3GMediumUK01JAN20033.01802301JAN2013
5Medium4GHighIndia01JAN201250.0601401JAN2022
6Medium4GHighUSA01JAN201170.0501501JAN2021
7High4GUltraSouthKorea01JAN2010100.0451601JAN2020
8High5GMediumIndia01JAN2020300.020601JAN2030
9Ultra High5GHighUSA01JAN2019500.015701JAN2029
10Ultra High5GUltraChina01JAN2019800.010701JAN2029
11Ultra High6GLowJapan01JAN20301000.05-401JAN2040
12Ultra High6GLowSouthKorea01JAN20301200.03-401JAN2040
13Ultra High6GLowUSA01JAN20311500.01-501JAN2041


4.DATA QUERY USING PROC SQL

proc sql;

    create table high_speed_networks as

    select Generation,Country,Speed_Mbps,Latency_ms,Speed_Tier

    from mobile_tiered

    where Speed_Mbps >= 100

    order by Speed_Mbps desc;

quit;

proc print data=high_speed_networks;

run;

OUTPUT:

ObsGenerationCountrySpeed_MbpsLatency_msSpeed_Tier
16GUSA15001Ultra High
26GSouthKorea12003Ultra High
36GJapan10005Ultra High
45GChina80010Ultra High
55GUSA50015Ultra High
65GIndia30020High
74GSouthKorea10045High


5.STATISTICAL SUMMARY USING PROC MEANS

proc means data=mobile_tiered mean min max;

    class Generation;

    var Speed_Mbps Latency_ms Years_Since_Launch;

run;

OUTPUT:

The MEANS Procedure

GenerationN ObsVariableMeanMinimumMaximum
2G2
Speed_Mbps
Latency_ms
Years_Since_Launch
0.1500000
490.0000000
31.5000000
0.1000000
480.0000000
31.0000000
0.2000000
500.0000000
32.0000000
3G2
Speed_Mbps
Latency_ms
Years_Since_Launch
2.5000000
190.0000000
22.5000000
2.0000000
180.0000000
22.0000000
3.0000000
200.0000000
23.0000000
4G3
Speed_Mbps
Latency_ms
Years_Since_Launch
73.3333333
51.6666667
15.0000000
50.0000000
45.0000000
14.0000000
100.0000000
60.0000000
16.0000000
5G3
Speed_Mbps
Latency_ms
Years_Since_Launch
533.3333333
15.0000000
6.6666667
300.0000000
10.0000000
6.0000000
800.0000000
20.0000000
7.0000000
6G3
Speed_Mbps
Latency_ms
Years_Since_Launch
1233.33
3.0000000
-4.3333333
1000.00
1.0000000
-5.0000000
1500.00
5.0000000
-4.0000000

6.DATA VISUALIZATION USING PROC SGPLOT

6.1 Speed vs Latency Scatter Plot

proc sgplot data=mobile_tiered;

    scatter x=Speed_Mbps y=Latency_ms / group=Generation;

    xaxis label="Speed (Mbps)";

    yaxis label="Latency (ms)";

    title "Speed vs Latency Across Mobile Network Generations";

run;

OUTPUT:

The SGPlot Procedure


7.ADDITIONAL DATE ANALYSIS – TIME TO NEXT GENERATION

proc sql;

    select Generation,Country,

           intck('year', Launch_Date, Next_Upgrade) as Upgrade_Cycle

    from mobile_tiered;

quit;

OUTPUT:

GenerationCountryUpgrade_Cycle
2GIndia10
2GUSA10
3GIndia10
3GUK10
4GIndia10
4GUSA10
4GSouthKorea10
5GIndia10
5GUSA10
5GChina10
6GJapan10
6GSouthKorea10
6GUSA10


8.NETWORK MATURITY FLAG USING DATA STEP LOGIC

data mobile_maturity;

    length Maturity_Status $18.;

    set mobile_tiered;

    /* Convert character to numeric if required */

    Years_Since_Launch_N = input(Years_Since_Launch, best.);

    if Years_Since_Launch_N >= 15 then  Maturity_Status  = "Mature";

    else if 5 <= Years_Since_Launch_N <= 14 then 

        Maturity_Status = "Growing";

    else if Years_Since_Launch_N < 5 then

        Maturity_Status = "Emerging";

run;

proc print data=mobile_maturity;

run;

OUTPUT:

ObsMaturity_StatusSpeed_TierGenerationCoverageCountryLaunch_DateSpeed_MbpsLatency_msYears_Since_LaunchNext_UpgradeYears_Since_Launch_N
1MatureVery Low2GHighIndia01JAN19950.15003101JAN200531
2MatureVery Low2GHighUSA01JAN19940.24803201JAN200432
3MatureLow3GMediumIndia01JAN20042.02002201JAN201422
4MatureLow3GMediumUK01JAN20033.01802301JAN201323
5GrowingMedium4GHighIndia01JAN201250.0601401JAN202214
6MatureMedium4GHighUSA01JAN201170.0501501JAN202115
7MatureHigh4GUltraSouthKorea01JAN2010100.0451601JAN202016
8GrowingHigh5GMediumIndia01JAN2020300.020601JAN20306
9GrowingUltra High5GHighUSA01JAN2019500.015701JAN20297
10GrowingUltra High5GUltraChina01JAN2019800.010701JAN20297
11EmergingUltra High6GLowJapan01JAN20301000.05-401JAN2040-4
12EmergingUltra High6GLowSouthKorea01JAN20301200.03-401JAN2040-4
13EmergingUltra High6GLowUSA01JAN20311500.01-501JAN2041-5


9.GENERATION-WISE SPEED TREND VISUALIZATION (PROC SGPLOT)

proc sgplot data=mobile_maturity;

    vbox Speed_Mbps / category=Generation;

    yaxis label="Speed (Mbps)";

    xaxis label="Mobile Generation";

    title "Speed Trend Across Mobile Network Generations";

run;

OUTPUT:
The SGPlot Procedure



About the Author:

SAS Learning Hub is a data analytics and SAS programming platform focused on clinical, financial, and real-world data analysis. The content is created by professionals with academic training in Pharmaceutics and hands-on experience in Base SAS, PROC SQL, Macros, SDTM, and ADaM, providing practical and industry-relevant SAS learning resources.

 

Disclaimer:

The datasets and analysis in this article are created for educational and demonstration purposes only. They do not represent real Infrastructure data.

 

Our Mission:

This blog provides industry-focused SAS programming tutorials and analytics projects covering finance, healthcare, and technology.

 

This project is suitable for:

SAS Programmer Interviews

SAS Programmer Job Seekers

SAS Analysts


--->Follow our blog for more SAS-based analytics projects and industry data models.



To deepen your understanding of SAS analytics, please refer to our other data science and industry-focused projects listed below:


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