E-LEARNING PLATFORM ANALYTICS USING DATA STEP | PROC SQL | PROC MEANS | PROC RANK | PROC UNIVARIATE | PROC SGPLOT | DATE FUNCTIONS AND MACROS
options nocenter;
1) CREATE RAW DATASET: elearning_raw
data work.elearning_raw;
informat Launch_Date date9. Last_Active_Date date9.;
format Launch_Date date9. Last_Active_Date date9.;
length Platform_Name $30 Country $20 Category $20;
input Platform_Name :$30. Active_Users Avg_Course_Price Completion_Rate Country :$20.
Category :$20. Launch_Date :date9. Last_Active_Date :date9.;
datalines;
"LearnSphere" 125000 49.99 72.5 "USA" "General" 15JAN2015 10NOV2025
"CodeHive" 90000 79.00 65.3 "India" "Tech" 02MAR2017 20OCT2025
"SkillUp" 45000 29.99 58.1 "UK" "Business" 10SEP2019 05NOV2025
"EduPulse" 30000 59.50 80.2 "Canada" "Design" 22JUN2016 01NOV2025
"BrightLearn" 175000 19.99 45.7 "USA" "Kids" 01JAN2014 29OCT2025
"DataTrail" 60000 99.00 70.0 "Germany" "Tech" 15AUG2018 12NOV2025
"MyTutor" 25000 15.00 55.0 "India" "Tutoring" 03APR2020 03NOV2025
"ProCert" 85000 149.0 82.6 "USA" "Professional" 12DEC2013 08NOV2025
"LanguageLoop" 42000 39.00 67.2 "Spain" "Language" 17MAY2016 30OCT2025
"CreativeCamp" 22000 34.50 60.5 "Australia" "Design" 11NOV2019 11NOV2025
"ExamReady" 98000 9.99 50.0 "India" "TestPrep" 07SEP2015 02NOV2025
"UpSkillNow" 52000 24.99 61.8 "UK" "Business" 29FEB2016 06NOV2025
;
run;
proc print data=work.elearning_raw;
run;
OUTPUT:
| Obs | Launch_Date | Last_Active_Date | Platform_Name | Country | Category | Active_Users | Avg_Course_Price | Completion_Rate |
|---|---|---|---|---|---|---|---|---|
| 1 | 15JAN2015 | 10NOV2025 | "LearnSphere" | "USA" | "General" | 125000 | 49.99 | 72.5 |
| 2 | 02MAR2017 | 20OCT2025 | "CodeHive" | "India" | "Tech" | 90000 | 79.00 | 65.3 |
| 3 | 10SEP2019 | 05NOV2025 | "SkillUp" | "UK" | "Business" | 45000 | 29.99 | 58.1 |
| 4 | 22JUN2016 | 01NOV2025 | "EduPulse" | "Canada" | "Design" | 30000 | 59.50 | 80.2 |
| 5 | 01JAN2014 | 29OCT2025 | "BrightLearn" | "USA" | "Kids" | 175000 | 19.99 | 45.7 |
| 6 | 15AUG2018 | 12NOV2025 | "DataTrail" | "Germany" | "Tech" | 60000 | 99.00 | 70.0 |
| 7 | 03APR2020 | 03NOV2025 | "MyTutor" | "India" | "Tutoring" | 25000 | 15.00 | 55.0 |
| 8 | 12DEC2013 | 08NOV2025 | "ProCert" | "USA" | "Professional" | 85000 | 149.00 | 82.6 |
| 9 | 17MAY2016 | 30OCT2025 | "LanguageLoop" | "Spain" | "Language" | 42000 | 39.00 | 67.2 |
| 10 | 11NOV2019 | 11NOV2025 | "CreativeCamp" | "Australia" | "Design" | 22000 | 34.50 | 60.5 |
| 11 | 07SEP2015 | 02NOV2025 | "ExamReady" | "India" | "TestPrep" | 98000 | 9.99 | 50.0 |
| 12 | 29FEB2016 | 06NOV2025 | "UpSkillNow" | "UK" | "Business" | 52000 | 24.99 | 61.8 |
2) Macro to compute date-based metrics using INTCK and INTNX
%macro compute_date_metrics(data=work.elearning_raw, out=work.elearning_dates);
data &out;
set &data;
/* Today's date - use TODAY() to get system date */
Today = today();
format Today date9.;
/* Days, months, years since launch */
Days_Since_Launch = intck('day', Launch_Date, Today);
Months_Since_Launch = intck('month', Launch_Date, Today);
Years_Since_Launch = intck('year', Launch_Date, Today);
/* Days between launch and last active (platform lifetime so far) */
Lifetime_Days = intck('day', Launch_Date, Last_Active_Date);
/* Next billing cycle date example: shift last active by 1 month to next cycle */
Next_Billing_Cycle = intnx('month', Last_Active_Date, 1, 'same');
/* Use INTNX 'samemonth' alignment or 'beginning','end' as required */
format Next_Billing_Cycle date9.;
/* Create a flag for recently_active: last active within last 30 days */
Recently_Active_Flag = (intck('day', Last_Active_Date, Today) <= 30);
/* Clean up odd values (safeguard) */
if Days_Since_Launch < 0 then Days_Since_Launch = .;
if Lifetime_Days < 0 then Lifetime_Days = .;
label Days_Since_Launch = "Days since Launch (INTCK day)"
Months_Since_Launch = "Months since Launch (INTCK month)"
Years_Since_Launch = "Years since Launch (INTCK year)"
Lifetime_Days = "Days between Launch and Last Active"
Next_Billing_Cycle = "Next Billing Cycle (INTNX month +1)";
run;
proc print data=&out;
run;
%mend compute_date_metrics;
%compute_date_metrics();
OUTPUT:
| Obs | Launch_Date | Last_Active_Date | Platform_Name | Country | Category | Active_Users | Avg_Course_Price | Completion_Rate | Today | Days_Since_Launch | Months_Since_Launch | Years_Since_Launch | Lifetime_Days | Next_Billing_Cycle | Recently_Active_Flag |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 15JAN2015 | 10NOV2025 | "LearnSphere" | "USA" | "General" | 125000 | 49.99 | 72.5 | 01DEC2025 | 3973 | 131 | 10 | 3952 | 10DEC2025 | 1 |
| 2 | 02MAR2017 | 20OCT2025 | "CodeHive" | "India" | "Tech" | 90000 | 79.00 | 65.3 | 01DEC2025 | 3196 | 105 | 8 | 3154 | 20NOV2025 | 0 |
| 3 | 10SEP2019 | 05NOV2025 | "SkillUp" | "UK" | "Business" | 45000 | 29.99 | 58.1 | 01DEC2025 | 2274 | 75 | 6 | 2248 | 05DEC2025 | 1 |
| 4 | 22JUN2016 | 01NOV2025 | "EduPulse" | "Canada" | "Design" | 30000 | 59.50 | 80.2 | 01DEC2025 | 3449 | 114 | 9 | 3419 | 01DEC2025 | 1 |
| 5 | 01JAN2014 | 29OCT2025 | "BrightLearn" | "USA" | "Kids" | 175000 | 19.99 | 45.7 | 01DEC2025 | 4352 | 143 | 11 | 4319 | 29NOV2025 | 0 |
| 6 | 15AUG2018 | 12NOV2025 | "DataTrail" | "Germany" | "Tech" | 60000 | 99.00 | 70.0 | 01DEC2025 | 2665 | 88 | 7 | 2646 | 12DEC2025 | 1 |
| 7 | 03APR2020 | 03NOV2025 | "MyTutor" | "India" | "Tutoring" | 25000 | 15.00 | 55.0 | 01DEC2025 | 2068 | 68 | 5 | 2040 | 03DEC2025 | 1 |
| 8 | 12DEC2013 | 08NOV2025 | "ProCert" | "USA" | "Professional" | 85000 | 149.00 | 82.6 | 01DEC2025 | 4372 | 144 | 12 | 4349 | 08DEC2025 | 1 |
| 9 | 17MAY2016 | 30OCT2025 | "LanguageLoop" | "Spain" | "Language" | 42000 | 39.00 | 67.2 | 01DEC2025 | 3485 | 115 | 9 | 3453 | 30NOV2025 | 0 |
| 10 | 11NOV2019 | 11NOV2025 | "CreativeCamp" | "Australia" | "Design" | 22000 | 34.50 | 60.5 | 01DEC2025 | 2212 | 73 | 6 | 2192 | 11DEC2025 | 1 |
| 11 | 07SEP2015 | 02NOV2025 | "ExamReady" | "India" | "TestPrep" | 98000 | 9.99 | 50.0 | 01DEC2025 | 3738 | 123 | 10 | 3709 | 02DEC2025 | 1 |
| 12 | 29FEB2016 | 06NOV2025 | "UpSkillNow" | "UK" | "Business" | 52000 | 24.99 | 61.8 | 01DEC2025 | 3563 | 118 | 9 | 3538 | 06DEC2025 | 1 |
3) PROC SQL: Aggregations by Country and Category
proc sql;
create table work.country_summary as
select Country,
count(*) as Platform_Count,
sum(Active_Users) as Total_Active_Users,
mean(Completion_Rate) as Avg_Completion_Rate format=6.2,
mean(Avg_Course_Price) as Avg_Price format=6.2
from work.elearning_dates
group by Country
order by Total_Active_Users desc;
quit;
proc print data=work.country_summary;
run;
OUTPUT:
| Obs | Country | Platform_Count | Total_Active_Users | Avg_Completion_Rate | Avg_Price |
|---|---|---|---|---|---|
| 1 | "USA" | 3 | 385000 | 66.93 | 72.99 |
| 2 | "India" | 3 | 213000 | 56.77 | 34.66 |
| 3 | "UK" | 2 | 97000 | 59.95 | 27.49 |
| 4 | "Germany" | 1 | 60000 | 70.00 | 99.00 |
| 5 | "Spain" | 1 | 42000 | 67.20 | 39.00 |
| 6 | "Canada" | 1 | 30000 | 80.20 | 59.50 |
| 7 | "Australia" | 1 | 22000 | 60.50 | 34.50 |
4) PROC MEANS: descriptive statistics for numeric fields
proc means data=work.elearning_dates n mean median std min max nmiss;
var Active_Users Avg_Course_Price Completion_Rate Days_Since_Launch Lifetime_Days;
output out=work.means_summary mean= / autoname;
run;
OUTPUT:
The MEANS Procedure
| Variable | Label | N | Mean | Median | Std Dev | Minimum | Maximum | N Miss |
|---|---|---|---|---|---|---|---|---|
Active_Users Avg_Course_Price Completion_Rate Days_Since_Launch Lifetime_Days | Days since Launch (INTCK day) Days between Launch and Last Active | 12 12 12 12 12 | 70750.00 50.8291667 64.0750000 3278.92 3251.58 | 56000.00 36.7500000 63.5500000 3467.00 3436.00 | 45938.94 40.7191604 11.2504646 808.4332163 807.2529691 | 22000.00 9.9900000 45.7000000 2068.00 2040.00 | 175000.00 149.0000000 82.6000000 4372.00 4349.00 | 0 0 0 0 0 |
5) PROC RANK usage: macro to rank platforms by chosen variable
%macro rank_platforms(data=work.elearning_dates, out=work.ranked_platforms, byvar=Active_Users, ties=low);
proc rank data=&data out=&out ties=&ties descending;
var &byvar;
ranks Rank_&byvar;
run;
proc print data=&out;
run;
%mend rank_platforms;
%rank_platforms(byvar=Active_Users, out=work.rank_by_users);
OUTPUT:
| Obs | Launch_Date | Last_Active_Date | Platform_Name | Country | Category | Active_Users | Avg_Course_Price | Completion_Rate | Today | Days_Since_Launch | Months_Since_Launch | Years_Since_Launch | Lifetime_Days | Next_Billing_Cycle | Recently_Active_Flag | Rank_Active_Users |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 15JAN2015 | 10NOV2025 | "LearnSphere" | "USA" | "General" | 125000 | 49.99 | 72.5 | 01DEC2025 | 3973 | 131 | 10 | 3952 | 10DEC2025 | 1 | 2 |
| 2 | 02MAR2017 | 20OCT2025 | "CodeHive" | "India" | "Tech" | 90000 | 79.00 | 65.3 | 01DEC2025 | 3196 | 105 | 8 | 3154 | 20NOV2025 | 0 | 4 |
| 3 | 10SEP2019 | 05NOV2025 | "SkillUp" | "UK" | "Business" | 45000 | 29.99 | 58.1 | 01DEC2025 | 2274 | 75 | 6 | 2248 | 05DEC2025 | 1 | 8 |
| 4 | 22JUN2016 | 01NOV2025 | "EduPulse" | "Canada" | "Design" | 30000 | 59.50 | 80.2 | 01DEC2025 | 3449 | 114 | 9 | 3419 | 01DEC2025 | 1 | 10 |
| 5 | 01JAN2014 | 29OCT2025 | "BrightLearn" | "USA" | "Kids" | 175000 | 19.99 | 45.7 | 01DEC2025 | 4352 | 143 | 11 | 4319 | 29NOV2025 | 0 | 1 |
| 6 | 15AUG2018 | 12NOV2025 | "DataTrail" | "Germany" | "Tech" | 60000 | 99.00 | 70.0 | 01DEC2025 | 2665 | 88 | 7 | 2646 | 12DEC2025 | 1 | 6 |
| 7 | 03APR2020 | 03NOV2025 | "MyTutor" | "India" | "Tutoring" | 25000 | 15.00 | 55.0 | 01DEC2025 | 2068 | 68 | 5 | 2040 | 03DEC2025 | 1 | 11 |
| 8 | 12DEC2013 | 08NOV2025 | "ProCert" | "USA" | "Professional" | 85000 | 149.00 | 82.6 | 01DEC2025 | 4372 | 144 | 12 | 4349 | 08DEC2025 | 1 | 5 |
| 9 | 17MAY2016 | 30OCT2025 | "LanguageLoop" | "Spain" | "Language" | 42000 | 39.00 | 67.2 | 01DEC2025 | 3485 | 115 | 9 | 3453 | 30NOV2025 | 0 | 9 |
| 10 | 11NOV2019 | 11NOV2025 | "CreativeCamp" | "Australia" | "Design" | 22000 | 34.50 | 60.5 | 01DEC2025 | 2212 | 73 | 6 | 2192 | 11DEC2025 | 1 | 12 |
| 11 | 07SEP2015 | 02NOV2025 | "ExamReady" | "India" | "TestPrep" | 98000 | 9.99 | 50.0 | 01DEC2025 | 3738 | 123 | 10 | 3709 | 02DEC2025 | 1 | 3 |
| 12 | 29FEB2016 | 06NOV2025 | "UpSkillNow" | "UK" | "Business" | 52000 | 24.99 | 61.8 | 01DEC2025 | 3563 | 118 | 9 | 3538 | 06DEC2025 | 1 | 7 |
%rank_platforms(byvar=Completion_Rate, out=work.rank_by_completion);
OUTPUT:
| Obs | Launch_Date | Last_Active_Date | Platform_Name | Country | Category | Active_Users | Avg_Course_Price | Completion_Rate | Today | Days_Since_Launch | Months_Since_Launch | Years_Since_Launch | Lifetime_Days | Next_Billing_Cycle | Recently_Active_Flag | Rank_Completion_Rate |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 15JAN2015 | 10NOV2025 | "LearnSphere" | "USA" | "General" | 125000 | 49.99 | 72.5 | 01DEC2025 | 3973 | 131 | 10 | 3952 | 10DEC2025 | 1 | 3 |
| 2 | 02MAR2017 | 20OCT2025 | "CodeHive" | "India" | "Tech" | 90000 | 79.00 | 65.3 | 01DEC2025 | 3196 | 105 | 8 | 3154 | 20NOV2025 | 0 | 6 |
| 3 | 10SEP2019 | 05NOV2025 | "SkillUp" | "UK" | "Business" | 45000 | 29.99 | 58.1 | 01DEC2025 | 2274 | 75 | 6 | 2248 | 05DEC2025 | 1 | 9 |
| 4 | 22JUN2016 | 01NOV2025 | "EduPulse" | "Canada" | "Design" | 30000 | 59.50 | 80.2 | 01DEC2025 | 3449 | 114 | 9 | 3419 | 01DEC2025 | 1 | 2 |
| 5 | 01JAN2014 | 29OCT2025 | "BrightLearn" | "USA" | "Kids" | 175000 | 19.99 | 45.7 | 01DEC2025 | 4352 | 143 | 11 | 4319 | 29NOV2025 | 0 | 12 |
| 6 | 15AUG2018 | 12NOV2025 | "DataTrail" | "Germany" | "Tech" | 60000 | 99.00 | 70.0 | 01DEC2025 | 2665 | 88 | 7 | 2646 | 12DEC2025 | 1 | 4 |
| 7 | 03APR2020 | 03NOV2025 | "MyTutor" | "India" | "Tutoring" | 25000 | 15.00 | 55.0 | 01DEC2025 | 2068 | 68 | 5 | 2040 | 03DEC2025 | 1 | 10 |
| 8 | 12DEC2013 | 08NOV2025 | "ProCert" | "USA" | "Professional" | 85000 | 149.00 | 82.6 | 01DEC2025 | 4372 | 144 | 12 | 4349 | 08DEC2025 | 1 | 1 |
| 9 | 17MAY2016 | 30OCT2025 | "LanguageLoop" | "Spain" | "Language" | 42000 | 39.00 | 67.2 | 01DEC2025 | 3485 | 115 | 9 | 3453 | 30NOV2025 | 0 | 5 |
| 10 | 11NOV2019 | 11NOV2025 | "CreativeCamp" | "Australia" | "Design" | 22000 | 34.50 | 60.5 | 01DEC2025 | 2212 | 73 | 6 | 2192 | 11DEC2025 | 1 | 8 |
| 11 | 07SEP2015 | 02NOV2025 | "ExamReady" | "India" | "TestPrep" | 98000 | 9.99 | 50.0 | 01DEC2025 | 3738 | 123 | 10 | 3709 | 02DEC2025 | 1 | 11 |
| 12 | 29FEB2016 | 06NOV2025 | "UpSkillNow" | "UK" | "Business" | 52000 | 24.99 | 61.8 | 01DEC2025 | 3563 | 118 | 9 | 3538 | 06DEC2025 | 1 | 7 |
/* Merge ranks into a single table using PROC SQL */
proc sql;
create table work.platforms_ranked as
select a.Platform_Name, a.Active_Users, a.Avg_Course_Price, a.Completion_Rate,
a.Country, a.Category, a.Launch_Date, a.Last_Active_Date,
b.Rank_Active_Users, c.Rank_Completion_Rate
from work.elearning_dates a
left join work.rank_by_users b on a.Platform_Name = b.Platform_Name
left join work.rank_by_completion c on a.Platform_Name = c.Platform_Name
order by Rank_Active_Users;
quit;
proc print data=work.platforms_ranked;
run;
OUTPUT:
| Obs | Platform_Name | Active_Users | Avg_Course_Price | Completion_Rate | Country | Category | Launch_Date | Last_Active_Date | Rank_Active_Users | Rank_Completion_Rate |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | "BrightLearn" | 175000 | 19.99 | 45.7 | "USA" | "Kids" | 01JAN2014 | 29OCT2025 | 1 | 12 |
| 2 | "LearnSphere" | 125000 | 49.99 | 72.5 | "USA" | "General" | 15JAN2015 | 10NOV2025 | 2 | 3 |
| 3 | "ExamReady" | 98000 | 9.99 | 50.0 | "India" | "TestPrep" | 07SEP2015 | 02NOV2025 | 3 | 11 |
| 4 | "CodeHive" | 90000 | 79.00 | 65.3 | "India" | "Tech" | 02MAR2017 | 20OCT2025 | 4 | 6 |
| 5 | "ProCert" | 85000 | 149.00 | 82.6 | "USA" | "Professional" | 12DEC2013 | 08NOV2025 | 5 | 1 |
| 6 | "DataTrail" | 60000 | 99.00 | 70.0 | "Germany" | "Tech" | 15AUG2018 | 12NOV2025 | 6 | 4 |
| 7 | "UpSkillNow" | 52000 | 24.99 | 61.8 | "UK" | "Business" | 29FEB2016 | 06NOV2025 | 7 | 7 |
| 8 | "SkillUp" | 45000 | 29.99 | 58.1 | "UK" | "Business" | 10SEP2019 | 05NOV2025 | 8 | 9 |
| 9 | "LanguageLoop" | 42000 | 39.00 | 67.2 | "Spain" | "Language" | 17MAY2016 | 30OCT2025 | 9 | 5 |
| 10 | "EduPulse" | 30000 | 59.50 | 80.2 | "Canada" | "Design" | 22JUN2016 | 01NOV2025 | 10 | 2 |
| 11 | "MyTutor" | 25000 | 15.00 | 55.0 | "India" | "Tutoring" | 03APR2020 | 03NOV2025 | 11 | 10 |
| 12 | "CreativeCamp" | 22000 | 34.50 | 60.5 | "Australia" | "Design" | 11NOV2019 | 11NOV2025 | 12 | 8 |
6) PROC UNIVARIATE: detailed distribution checks (Active_Users)
proc univariate data=work.elearning_dates;
var Active_Users Avg_Course_Price Completion_Rate;
histogram Active_Users / normal;
inset mean median std / pos=ne;
run;
OUTPUT:
The UNIVARIATE Procedure
Variable: Active_Users
| Moments | |||
|---|---|---|---|
| N | 12 | Sum Weights | 12 |
| Mean | 70750 | Sum Observations | 849000 |
| Std Deviation | 45938.9417 | Variance | 2110386364 |
| Skewness | 1.11957429 | Kurtosis | 0.97488514 |
| Uncorrected SS | 8.3281E10 | Corrected SS | 2.32143E10 |
| Coeff Variation | 64.9313663 | Std Error Mean | 13261.4302 |
| Basic Statistical Measures | |||
|---|---|---|---|
| Location | Variability | ||
| Mean | 70750.00 | Std Deviation | 45939 |
| Median | 56000.00 | Variance | 2110386364 |
| Mode | . | Range | 153000 |
| Interquartile Range | 58000 | ||
| Tests for Location: Mu0=0 | ||||
|---|---|---|---|---|
| Test | Statistic | p Value | ||
| Student's t | t | 5.33502 | Pr > |t| | 0.0002 |
| Sign | M | 6 | Pr >= |M| | 0.0005 |
| Signed Rank | S | 39 | Pr >= |S| | 0.0005 |
| Quantiles (Definition 5) | |
|---|---|
| Level | Quantile |
| 100% Max | 175000 |
| 99% | 175000 |
| 95% | 175000 |
| 90% | 125000 |
| 75% Q3 | 94000 |
| 50% Median | 56000 |
| 25% Q1 | 36000 |
| 10% | 25000 |
| 5% | 22000 |
| 1% | 22000 |
| 0% Min | 22000 |
| Extreme Observations | |||
|---|---|---|---|
| Lowest | Highest | ||
| Value | Obs | Value | Obs |
| 22000 | 10 | 85000 | 8 |
| 25000 | 7 | 90000 | 2 |
| 30000 | 4 | 98000 | 11 |
| 42000 | 9 | 125000 | 1 |
| 45000 | 3 | 175000 | 5 |
The UNIVARIATE Procedure
The UNIVARIATE Procedure
Fitted Normal Distribution for Active_Users
| Parameters for Normal Distribution | ||
|---|---|---|
| Parameter | Symbol | Estimate |
| Mean | Mu | 70750 |
| Std Dev | Sigma | 45938.94 |
| Goodness-of-Fit Tests for Normal Distribution | ||||
|---|---|---|---|---|
| Test | Statistic | p Value | ||
| Kolmogorov-Smirnov | D | 0.17584327 | Pr > D | >0.150 |
| Cramer-von Mises | W-Sq | 0.06677709 | Pr > W-Sq | >0.250 |
| Anderson-Darling | A-Sq | 0.44404111 | Pr > A-Sq | 0.240 |
| Quantiles for Normal Distribution | ||
|---|---|---|
| Percent | Quantile | |
| Observed | Estimated | |
| 1.0 | 22000.0 | -36119.96 |
| 5.0 | 22000.0 | -4812.83 |
| 10.0 | 25000.0 | 11876.88 |
| 25.0 | 36000.0 | 39764.65 |
| 50.0 | 56000.0 | 70750.00 |
| 75.0 | 94000.0 | 101735.35 |
| 90.0 | 125000.0 | 129623.12 |
| 95.0 | 175000.0 | 146312.83 |
| 99.0 | 175000.0 | 177619.96 |
The UNIVARIATE Procedure
Variable: Avg_Course_Price
| Moments | |||
|---|---|---|---|
| N | 12 | Sum Weights | 12 |
| Mean | 50.8291667 | Sum Observations | 609.95 |
| Std Deviation | 40.7191604 | Variance | 1658.05003 |
| Skewness | 1.46257027 | Kurtosis | 1.98284584 |
| Uncorrected SS | 49241.8005 | Corrected SS | 18238.5503 |
| Coeff Variation | 80.1098328 | Std Error Mean | 11.7546091 |
| Basic Statistical Measures | |||
|---|---|---|---|
| Location | Variability | ||
| Mean | 50.82917 | Std Deviation | 40.71916 |
| Median | 36.75000 | Variance | 1658 |
| Mode | . | Range | 139.01000 |
| Interquartile Range | 46.76000 | ||
| Tests for Location: Mu0=0 | ||||
|---|---|---|---|---|
| Test | Statistic | p Value | ||
| Student's t | t | 4.32419 | Pr > |t| | 0.0012 |
| Sign | M | 6 | Pr >= |M| | 0.0005 |
| Signed Rank | S | 39 | Pr >= |S| | 0.0005 |
| Quantiles (Definition 5) | |
|---|---|
| Level | Quantile |
| 100% Max | 149.00 |
| 99% | 149.00 |
| 95% | 149.00 |
| 90% | 99.00 |
| 75% Q3 | 69.25 |
| 50% Median | 36.75 |
| 25% Q1 | 22.49 |
| 10% | 15.00 |
| 5% | 9.99 |
| 1% | 9.99 |
| 0% Min | 9.99 |
| Extreme Observations | |||
|---|---|---|---|
| Lowest | Highest | ||
| Value | Obs | Value | Obs |
| 9.99 | 11 | 49.99 | 1 |
| 15.00 | 7 | 59.50 | 4 |
| 19.99 | 5 | 79.00 | 2 |
| 24.99 | 12 | 99.00 | 6 |
| 29.99 | 3 | 149.00 | 8 |
The UNIVARIATE Procedure
Variable: Completion_Rate
| Moments | |||
|---|---|---|---|
| N | 12 | Sum Weights | 12 |
| Mean | 64.075 | Sum Observations | 768.9 |
| Std Deviation | 11.2504646 | Variance | 126.572955 |
| Skewness | 0.10555216 | Kurtosis | -0.5589518 |
| Uncorrected SS | 50659.57 | Corrected SS | 1392.3025 |
| Coeff Variation | 17.5582749 | Std Error Mean | 3.24772939 |
| Basic Statistical Measures | |||
|---|---|---|---|
| Location | Variability | ||
| Mean | 64.07500 | Std Deviation | 11.25046 |
| Median | 63.55000 | Variance | 126.57295 |
| Mode | . | Range | 36.90000 |
| Interquartile Range | 14.70000 | ||
| Tests for Location: Mu0=0 | ||||
|---|---|---|---|---|
| Test | Statistic | p Value | ||
| Student's t | t | 19.72917 | Pr > |t| | <.0001 |
| Sign | M | 6 | Pr >= |M| | 0.0005 |
| Signed Rank | S | 39 | Pr >= |S| | 0.0005 |
| Quantiles (Definition 5) | |
|---|---|
| Level | Quantile |
| 100% Max | 82.60 |
| 99% | 82.60 |
| 95% | 82.60 |
| 90% | 80.20 |
| 75% Q3 | 71.25 |
| 50% Median | 63.55 |
| 25% Q1 | 56.55 |
| 10% | 50.00 |
| 5% | 45.70 |
| 1% | 45.70 |
| 0% Min | 45.70 |
| Extreme Observations | |||
|---|---|---|---|
| Lowest | Highest | ||
| Value | Obs | Value | Obs |
| 45.7 | 5 | 67.2 | 9 |
| 50.0 | 11 | 70.0 | 6 |
| 55.0 | 7 | 72.5 | 1 |
| 58.1 | 3 | 80.2 | 4 |
| 60.5 | 10 | 82.6 | 8 |
7) PROC SGPLOT: visualizations
/* Bar: Total Active Users by Category */
proc sgplot data=work.elearning_dates;
vbar Category / response=Active_Users stat=sum datalabel;
title "Total Active Users by Category";
run;
OUTPUT:
/* Scatter: Avg Course Price vs Completion Rate (bubble sized by Active Users) */
proc sgplot data=work.elearning_dates;
bubble x=Avg_Course_Price y=Completion_Rate size=Active_Users / datalabel=Platform_Name;
xaxis label="Average Course Price (USD)";
yaxis label="Completion Rate (%)";
title "Price vs Completion Rate (bubble size = Active Users)";
run;
OUTPUT:
/* Box plot: Completion rate by Category */
proc sgplot data=work.elearning_dates;
vbox Completion_Rate / category=Category;
title "Completion Rate Distribution by Category";
run;
OUTPUT:
8) Example: create top N macro using ranked table
%macro top_n_by(data=work.platforms_ranked, byrank=Rank_Active_Users, n=5, out=work.topN);
data &out;
set &data;
if &byrank < &n then output;
run;
%mend top_n_by;
%top_n_by(n=5, out=work.top5_by_users);
/* show top 5 by users */
proc print data=work.top5_by_users label noobs;
var Platform_Name Active_Users Rank_Active_Users Completion_Rate Rank_Completion_Rate Country Category;
title "Top 5 Platforms by Active Users";
run;
OUTPUT:
| Platform_Name | Active_Users | Rank for Variable Active_Users | Completion_Rate | Rank for Variable Completion_Rate | Country | Category |
|---|---|---|---|---|---|---|
| "BrightLearn" | 175000 | 1 | 45.7 | 12 | "USA" | "Kids" |
| "LearnSphere" | 125000 | 2 | 72.5 | 3 | "USA" | "General" |
| "ExamReady" | 98000 | 3 | 50.0 | 11 | "India" | "TestPrep" |
| "CodeHive" | 90000 | 4 | 65.3 | 6 | "India" | "Tech" |