311.Which mobile payment apps handle the highest number of transactions, and are they truly the most reliable?A Complete Sas Study
Which mobile payment apps handle the highest number of transactions, and are they truly the most reliable?A Complete Sas Study
options nocenter validvarname=any;
1. CREATING MOBILE PAYMENTS DATASET USING DATA STEP
data work.mobile_payments;
infile datalines dlm=',' dsd truncover;
length App_Name $20 Country $15 Security_Level $10;
input App_Name $
Country $
Users_Millions
Transactions_Per_Day
Security_Level $
Avg_Transaction_Value;
datalines;
GooglePay,India,120,80,High,18.5
PhonePe,India,130,92,High,17.4
Paytm,India,90,65,Medium,10.2
AmazonPay,India,55,28,High,22.1
BHIM,India,25,12,High,14.5
PayPal,USA,420,35,High,45.0
Venmo,USA,90,18,Medium,32.5
CashApp,USA,70,22,Medium,28.3
Alipay,China,900,320,High,55.8
WeChatPay,China,850,310,High,48.9
GrabPay,Singapore,30,10,Medium,19.0
M-Pesa,Kenya,50,22,High,6.5
;
run;
proc print data=work.mobile_payments;
title "RAW DATASET: MOBILE PAYMENT APPLICATIONS";
run;
OUTPUT:
| Obs | App_Name | Country | Security_Level | Users_Millions | Transactions_Per_Day | Avg_Transaction_Value |
|---|---|---|---|---|---|---|
| 1 | GooglePay | India | High | 120 | 80 | 18.5 |
| 2 | PhonePe | India | High | 130 | 92 | 17.4 |
| 3 | Paytm | India | Medium | 90 | 65 | 10.2 |
| 4 | AmazonPay | India | High | 55 | 28 | 22.1 |
| 5 | BHIM | India | High | 25 | 12 | 14.5 |
| 6 | PayPal | USA | High | 420 | 35 | 45.0 |
| 7 | Venmo | USA | Medium | 90 | 18 | 32.5 |
| 8 | CashApp | USA | Medium | 70 | 22 | 28.3 |
| 9 | Alipay | China | High | 900 | 320 | 55.8 |
| 10 | WeChatPay | China | High | 850 | 310 | 48.9 |
| 11 | GrabPay | Singapore | Medium | 30 | 10 | 19.0 |
| 12 | M-Pesa | Kenya | High | 50 | 22 | 6.5 |
2. PROC SORT – SORT APPS BY USERS
proc sort data=work.mobile_payments out=work.sorted_apps;
by descending Users_Millions;
run;
proc print data=work.sorted_apps;
title "APPS SORTED BY NUMBER OF USERS";
run;
OUTPUT:
| Obs | App_Name | Country | Security_Level | Users_Millions | Transactions_Per_Day | Avg_Transaction_Value |
|---|---|---|---|---|---|---|
| 1 | Alipay | China | High | 900 | 320 | 55.8 |
| 2 | WeChatPay | China | High | 850 | 310 | 48.9 |
| 3 | PayPal | USA | High | 420 | 35 | 45.0 |
| 4 | PhonePe | India | High | 130 | 92 | 17.4 |
| 5 | GooglePay | India | High | 120 | 80 | 18.5 |
| 6 | Paytm | India | Medium | 90 | 65 | 10.2 |
| 7 | Venmo | USA | Medium | 90 | 18 | 32.5 |
| 8 | CashApp | USA | Medium | 70 | 22 | 28.3 |
| 9 | AmazonPay | India | High | 55 | 28 | 22.1 |
| 10 | M-Pesa | Kenya | High | 50 | 22 | 6.5 |
| 11 | GrabPay | Singapore | Medium | 30 | 10 | 19.0 |
| 12 | BHIM | India | High | 25 | 12 | 14.5 |
3. PROC MEANS – STATISTICAL ANALYSIS
proc means data=work.mobile_payments mean min max stddev;
var Users_Millions Transactions_Per_Day Avg_Transaction_Value;
title "STATISTICAL SUMMARY OF MOBILE PAYMENT APPS";
run;
OUTPUT:
The MEANS Procedure
| Variable | Mean | Minimum | Maximum | Std Dev |
|---|---|---|---|---|
Users_Millions Transactions_Per_Day Avg_Transaction_Value | 235.8333333 84.5000000 26.5583333 | 25.0000000 10.0000000 6.5000000 | 900.0000000 320.0000000 55.8000000 | 316.3630921 110.9672351 15.8796873 |
4. PROC FREQ – FREQUENCY OF SECURITY LEVELS
proc freq data=work.mobile_payments;
tables Security_Level;
title "FREQUENCY OF SECURITY LEVELS ACROSS APPS";
run;
OUTPUT:
The FREQ Procedure
| Security_Level | Frequency | Percent | Cumulative Frequency | Cumulative Percent |
|---|---|---|---|---|
| High | 8 | 66.67 | 8 | 66.67 |
| Medium | 4 | 33.33 | 12 | 100.00 |
5. PROC FORMAT – CUSTOM FORMATTING FOR SECURITY LEVEL
proc format;
value $secfmt
'High' = 'HIGHLY SECURE'
'Medium' = 'MODERATELY SECURE'
'Low' = 'LOW SECURITY';
run;
LOG:
proc print data=work.mobile_payments;
format Security_Level $secfmt.;
title "MOBILE APPS WITH SECURITY LEVEL FORMAT APPLIED";
run;
OUTPUT:
| Obs | App_Name | Country | Security_Level | Users_Millions | Transactions_Per_Day | Avg_Transaction_Value |
|---|---|---|---|---|---|---|
| 1 | GooglePay | India | HIGHLY SECURE | 120 | 80 | 18.5 |
| 2 | PhonePe | India | HIGHLY SECURE | 130 | 92 | 17.4 |
| 3 | Paytm | India | MODERATELY SECURE | 90 | 65 | 10.2 |
| 4 | AmazonPay | India | HIGHLY SECURE | 55 | 28 | 22.1 |
| 5 | BHIM | India | HIGHLY SECURE | 25 | 12 | 14.5 |
| 6 | PayPal | USA | HIGHLY SECURE | 420 | 35 | 45.0 |
| 7 | Venmo | USA | MODERATELY SECURE | 90 | 18 | 32.5 |
| 8 | CashApp | USA | MODERATELY SECURE | 70 | 22 | 28.3 |
| 9 | Alipay | China | HIGHLY SECURE | 900 | 320 | 55.8 |
| 10 | WeChatPay | China | HIGHLY SECURE | 850 | 310 | 48.9 |
| 11 | GrabPay | Singapore | MODERATELY SECURE | 30 | 10 | 19.0 |
| 12 | M-Pesa | Kenya | HIGHLY SECURE | 50 | 22 | 6.5 |
6. PROC SQL – CALCULATE TOTAL USERS AND AVG TRANSACTION VALUE
proc sql;
create table work.summary_sql as
select
Country,
count(*) as Total_Apps,
sum(Users_Millions) as Total_Users_M,
avg(Avg_Transaction_Value) as Avg_Txn_Value
from work.mobile_payments
group by Country;
quit;
proc print data=work.summary_sql;
title "COUNTRY-WISE SUMMARY FROM PROC SQL";
run;
OUTPUT:
| Obs | Country | Total_Apps | Total_Users_M | Avg_Txn_Value |
|---|---|---|---|---|
| 1 | China | 2 | 1750 | 52.3500 |
| 2 | India | 5 | 420 | 16.5400 |
| 3 | Kenya | 1 | 50 | 6.5000 |
| 4 | Singapore | 1 | 30 | 19.0000 |
| 5 | USA | 3 | 580 | 35.2667 |
7. MACRO – CALCULATE AVERAGE USERS PER SECURITY LEVEL
%macro security_avg(level);
proc sql;
select
"&level" as Security_Level,
avg(Users_Millions) as Avg_Users
from work.mobile_payments
where Security_Level = "&level";
quit;
%mend security_avg;
%security_avg(High);
OUTPUT:
| Security_Level | Avg_Users |
|---|---|
| High | 318.75 |
%security_avg(Medium);
OUTPUT:
| Security_Level | Avg_Users |
|---|---|
| Medium | 70 |
%security_avg(Low); /* No app with Low, returns missing */
OUTPUT:
| Security_Level | Avg_Users |
|---|---|
| Low | . |
Comments
Post a Comment