Introduction

In this analysis, we will focus on understanding factors influencing the Final Amount Paid in digital wallet transactions. We will perform an ANOVA test to analyze the effect of different Product Categories on the Final Amount Paid. Additionally, we will build a linear regression model to analyze the relationship between Product Amount and the Final Amount Paid.

# Count the number of unique product categories
n_categories <- length(unique(data$ProductCategory))
n_categories
## [1] 0
# If there are more than 10 categories, consolidate (for example purposes)
if (n_categories > 10) {
  # Example: Consolidating categories into broader groups
  data$ProductCategory <- recode(data$ProductCategory, 
                                 "Gaming Credits" = "Entertainment",
                                 "Streaming Service" = "Entertainment",
                                 "Flight Booking" = "Travel",
                                 "Bus Ticket" = "Travel",
                                 "Movie Ticket" = "Entertainment",
                                 "Food Delivery" = "Food",
                                 "Grocery Shopping" = "Food",
                                 "Electricity Bill" = "Utilities",
                                 "Gas Bill" = "Utilities",
                                 .default = "Other")
}

Running the ANOVA Test

# Run ANOVA
anova_model <- aov(final_amount_paid ~ product_category, data = data)
summary(anova_model)
##                    Df    Sum Sq  Mean Sq F value Pr(>F)
## product_category   19 2.258e+08 11881877    1.43  0.101
## Residuals        4980 4.138e+10  8310110
# Tukey's HSD test for post-hoc analysis
tukey_results <- TukeyHSD(anova_model)
tukey_results
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = final_amount_paid ~ product_category, data = data)
## 
## $product_category
##                                             diff        lwr        upr
## Education Fee-Bus Ticket             -29.2838241  -929.2204  870.65271
## Electricity Bill-Bus Ticket          194.8095189  -732.1062 1121.72524
## Flight Booking-Bus Ticket            455.0169726  -508.4513 1418.48528
## Food Delivery-Bus Ticket             335.3949876  -585.4566 1256.24655
## Gaming Credits-Bus Ticket            174.3562758  -772.6721 1121.38468
## Gas Bill-Bus Ticket                  700.3637745  -228.3393 1629.06689
## Gift Card-Bus Ticket                -121.6183984 -1079.3908  836.15401
## Grocery Shopping-Bus Ticket           21.6476585  -918.3313  961.62661
## Hotel Booking-Bus Ticket              68.4227934  -840.3591  977.20465
## Insurance Premium-Bus Ticket        -160.3062478 -1113.6811  793.06861
## Internet Bill-Bus Ticket             605.0683899  -339.9081 1550.04488
## Loan Repayment-Bus Ticket            195.3220234  -737.9615 1128.60558
## Mobile Recharge-Bus Ticket           215.2995247  -721.7682 1152.36728
## Movie Ticket-Bus Ticket              165.8445230  -744.4786 1076.16763
## Online Shopping-Bus Ticket           220.6775333  -714.4845 1155.83953
## Rent Payment-Bus Ticket              263.3025147  -664.5038 1191.10880
## Streaming Service-Bus Ticket         142.8016213  -748.2668 1033.87008
## Taxi Fare-Bus Ticket                 354.9167151  -568.4980 1278.33145
## Water Bill-Bus Ticket                381.1788565  -528.3711 1290.72884
## Electricity Bill-Education Fee       224.0933430  -659.0228 1107.20948
## Flight Booking-Education Fee         484.3007967  -437.1071 1405.70871
## Food Delivery-Education Fee          364.6788117  -512.0703 1241.42790
## Gaming Credits-Education Fee         203.6400999  -700.5635 1107.84371
## Gas Bill-Education Fee               729.6475986  -155.3444 1614.63960
## Gift Card-Education Fee              -92.3345742 -1007.7849  823.11578
## Grocery Shopping-Education Fee        50.9314826  -845.8861  947.74907
## Hotel Booking-Education Fee           97.7066176  -766.3569  961.77017
## Insurance Premium-Education Fee     -131.0224236 -1041.8709  779.82607
## Internet Bill-Education Fee          634.3522141  -267.7021 1536.40649
## Loan Repayment-Education Fee         224.6058476  -665.1916 1114.40333
## Mobile Recharge-Education Fee        244.5833488  -649.1825 1138.34916
## Movie Ticket-Education Fee           195.1283471  -670.5561 1060.81276
## Online Shopping-Education Fee        249.9613574  -641.8062 1141.72888
## Rent Payment-Education Fee           292.5863388  -591.4645 1176.63717
## Streaming Service-Education Fee      172.0854454  -673.3283 1017.49917
## Taxi Fare-Education Fee              384.2005392  -495.2403 1263.64135
## Water Bill-Education Fee             410.4626807  -454.4087 1275.33408
## Flight Booking-Electricity Bill      260.2074537  -687.5686 1207.98355
## Food Delivery-Electricity Bill       140.5854687  -763.8348 1045.00570
## Gaming Credits-Electricity Bill      -20.4532431  -951.5124  910.60591
## Gas Bill-Electricity Bill            505.5542556  -406.8589 1417.96744
## Gift Card-Electricity Bill          -316.4279173 -1258.4132  625.55740
## Grocery Shopping-Electricity Bill   -173.1618604 -1097.0497  750.72600
## Hotel Booking-Electricity Bill      -126.3867255 -1018.5150  765.74152
## Insurance Premium-Electricity Bill  -355.1157667 -1292.6295  582.39795
## Internet Bill-Electricity Bill       410.2588710  -518.7131 1339.23084
## Loan Repayment-Electricity Bill        0.5125045  -916.5625  917.58750
## Mobile Recharge-Electricity Bill      20.4900058  -900.4358  941.41580
## Movie Ticket-Electricity Bill        -28.9649959  -922.6632  864.73322
## Online Shopping-Electricity Bill      25.8680144  -893.1185  944.85458
## Rent Payment-Electricity Bill         68.4929958  -843.0073  979.99333
## Streaming Service-Electricity Bill   -52.0078976  -926.0853  822.06953
## Taxi Fare-Electricity Bill           160.1071962  -746.9226 1067.13703
## Water Bill-Electricity Bill          186.3693376  -706.5414 1079.28004
## Food Delivery-Flight Booking        -119.6219850 -1061.4682  822.22427
## Gaming Credits-Flight Booking       -280.6606968 -1248.1159  686.79451
## Gas Bill-Flight Booking              245.3468019  -704.1774 1194.87102
## Gift Card-Flight Booking            -576.6353710 -1554.6102  401.33945
## Grocery Shopping-Flight Booking     -433.3693141 -1393.9250  527.18636
## Hotel Booking-Flight Booking        -386.5941792 -1316.6432  543.45487
## Insurance Premium-Flight Booking    -615.3232204 -1588.9917  358.34530
## Internet Bill-Flight Booking         150.0514173  -815.3953 1115.49812
## Loan Repayment-Flight Booking       -259.6949492 -1213.6996  694.30975
## Mobile Recharge-Flight Booking      -239.7174479 -1197.4245  717.98958
## Movie Ticket-Flight Booking         -289.1724496 -1220.7276  642.38266
## Online Shopping-Flight Booking      -234.3394393 -1190.1819  721.50298
## Rent Payment-Flight Booking         -191.7144579 -1140.3615  756.93262
## Streaming Service-Flight Booking    -312.2153513 -1224.9638  600.53312
## Taxi Fare-Flight Booking            -100.1002575 -1044.4527  844.25219
## Water Bill-Flight Booking            -73.8381161 -1004.6377  856.96151
## Gaming Credits-Food Delivery        -161.0387118 -1086.0609  763.98345
## Gas Bill-Food Delivery               364.9687869  -541.2832 1271.22078
## Gift Card-Food Delivery             -457.0133860 -1393.0322  479.00541
## Grocery Shopping-Food Delivery      -313.7473291 -1231.5510  604.05637
## Hotel Booking-Food Delivery         -266.9721941 -1152.7982  618.85378
## Insurance Premium-Food Delivery     -495.7012353 -1427.2198  435.81732
## Internet Bill-Food Delivery          269.6734023  -653.2479 1192.59472
## Loan Repayment-Food Delivery        -140.0729641 -1051.0183  770.87236
## Mobile Recharge-Food Delivery       -120.0954629 -1034.9174  794.72647
## Movie Ticket-Food Delivery          -169.5504646 -1056.9576  717.85663
## Online Shopping-Food Delivery       -114.7174543 -1027.5872  798.15228
## Rent Payment-Food Delivery           -72.0924729  -977.4254  833.24045
## Streaming Service-Food Delivery     -192.5933663 -1060.2374  675.05068
## Taxi Fare-Food Delivery               19.5217275  -881.3101  920.35355
## Water Bill-Food Delivery              45.7838689  -840.8301  932.39786
## Gas Bill-Gaming Credits              526.0074987  -406.8311 1458.84611
## Gift Card-Gaming Credits            -295.9746741 -1257.7576  665.80824
## Grocery Shopping-Gaming Credits     -152.7086173 -1096.7737  791.35644
## Hotel Booking-Gaming Credits        -105.9334823 -1018.9411  807.07411
## Insurance Premium-Gaming Credits    -334.6625235 -1292.0663  622.74126
## Internet Bill-Gaming Credits         430.7121142  -518.3290 1379.75319
## Loan Repayment-Gaming Credits         20.9657477  -916.4331  958.36459
## Mobile Recharge-Gaming Credits        40.9432489  -900.2232  982.10974
## Movie Ticket-Gaming Credits           -8.5117528  -923.0535  906.02996
## Online Shopping-Gaming Credits        46.3212575  -892.9478  985.59031
## Rent Payment-Gaming Credits           88.9462389  -842.9995 1020.89200
## Streaming Service-Gaming Credits     -31.5546545  -926.9324  863.82314
## Taxi Fare-Gaming Credits             180.5604393  -747.0134 1108.13425
## Water Bill-Gaming Credits            206.8225808  -706.9496 1120.59474
## Gift Card-Gas Bill                  -821.9821729 -1765.7263  121.76200
## Grocery Shopping-Gas Bill           -678.7161160 -1604.3972  246.96499
## Hotel Booking-Gas Bill              -631.9409810 -1525.9262  262.04421
## Insurance Premium-Gas Bill          -860.6700222 -1799.9510   78.61092
## Internet Bill-Gas Bill               -95.2953845 -1026.0508  835.46003
## Loan Repayment-Gas Bill             -505.0417510 -1423.9233  413.83978
## Mobile Recharge-Gas Bill            -485.0642498 -1407.7890  437.66054
## Movie Ticket-Gas Bill               -534.5192515 -1430.0712  361.03266
## Online Shopping-Gas Bill            -479.6862412 -1400.4756  441.10311
## Rent Payment-Gas Bill               -437.0612598 -1350.3792  476.25664
## Streaming Service-Gas Bill          -557.5621532 -1433.5348  318.41049
## Taxi Fare-Gas Bill                  -345.4470594 -1254.3034  563.40928
## Water Bill-Gas Bill                 -319.1849179 -1213.9509  575.58111
## Grocery Shopping-Gift Card           143.2660569  -811.5763 1098.10846
## Hotel Booking-Gift Card              190.0411918  -734.1060 1114.18839
## Insurance Premium-Gift Card          -38.6878494 -1006.7205  929.34479
## Internet Bill-Gift Card              726.6867883  -233.0758 1686.44934
## Loan Repayment-Gift Card             316.9404218  -631.3115 1265.19238
## Mobile Recharge-Gift Card            336.9179231  -615.0587 1288.89458
## Movie Ticket-Gift Card               287.4629214  -638.1999 1213.12578
## Online Shopping-Gift Card            342.2959317  -607.8049 1292.39674
## Rent Payment-Gift Card               384.9209131  -557.9407 1327.78256
## Streaming Service-Gift Card          264.4200197  -642.3140 1171.15404
## Taxi Fare-Gift Card                  476.5351135  -462.0054 1415.07566
## Water Bill-Gift Card                 502.7972549  -422.1053 1427.69982
## Hotel Booking-Grocery Shopping        46.7751349  -858.9182  952.46851
## Insurance Premium-Grocery Shopping  -181.9539063 -1132.3852  768.47739
## Internet Bill-Grocery Shopping       583.4207314  -358.5860 1525.42741
## Loan Repayment-Grocery Shopping      173.6743649  -756.6021 1103.95079
## Mobile Recharge-Grocery Shopping     193.6518662  -740.4209 1127.72467
## Movie Ticket-Grocery Shopping        144.1968645  -763.0430 1051.43673
## Online Shopping-Grocery Shopping     199.0298748  -733.1310 1131.19080
## Rent Payment-Grocery Shopping        241.6548562  -683.1265 1166.43620
## Streaming Service-Grocery Shopping   121.1539628  -766.7644 1009.07233
## Taxi Fare-Grocery Shopping           333.2690566  -587.1063 1253.64441
## Water Bill-Grocery Shopping          359.5311980  -546.9329 1265.99532
## Insurance Premium-Hotel Booking     -228.7290412 -1148.3179  690.85982
## Internet Bill-Hotel Booking          536.6455965  -374.2334 1447.52463
## Loan Repayment-Hotel Booking         126.8992300  -771.8434 1025.64182
## Mobile Recharge-Hotel Booking        146.8767312  -755.7949 1049.54834
## Movie Ticket-Hotel Booking            97.4217296  -777.4544  972.29784
## Online Shopping-Hotel Booking        152.2547399  -748.4383 1052.94781
## Rent Payment-Hotel Booking           194.8797213  -698.1738 1087.93323
## Streaming Service-Hotel Booking       74.3788278  -780.4446  929.20223
## Taxi Fare-Hotel Booking              286.4939216  -601.9963 1174.98412
## Water Bill-Hotel Booking             312.7560631  -561.3156 1186.82770
## Internet Bill-Insurance Premium      765.3746377  -189.9995 1720.74879
## Loan Repayment-Insurance Premium     355.6282712  -588.1818 1299.43832
## Mobile Recharge-Insurance Premium    375.6057724  -571.9464 1323.15798
## Movie Ticket-Insurance Premium       326.1507708  -594.9613 1247.26280
## Online Shopping-Insurance Premium    380.9837811  -564.6838 1326.65136
## Rent Payment-Insurance Premium       423.6087625  -514.7855 1362.00299
## Streaming Service-Insurance Premium  303.1078690  -598.9798 1205.19557
## Taxi Fare-Insurance Premium          515.2229628  -418.8295 1449.27542
## Water Bill-Insurance Premium         541.4851043  -378.8629 1461.83307
## Loan Repayment-Internet Bill        -409.7463665 -1345.0722  525.57944
## Mobile Recharge-Internet Bill       -389.7688652 -1328.8706  549.33290
## Movie Ticket-Internet Bill          -439.2238669 -1351.6406  473.19288
## Online Shopping-Internet Bill       -384.3908566 -1321.5910  552.80929
## Rent Payment-Internet Bill          -341.7658752 -1271.6264  588.09469
## Streaming Service-Internet Bill     -462.2667686 -1355.4740  430.94046
## Taxi Fare-Internet Bill             -250.1516748 -1175.6304  675.32708
## Water Bill-Internet Bill            -223.8895334 -1135.5349  687.75586
## Mobile Recharge-Loan Repayment        19.9775012  -907.3573  947.31226
## Movie Ticket-Loan Repayment          -29.4775005  -929.7785  870.82353
## Online Shopping-Loan Repayment        25.3555099  -900.0535  950.76447
## Rent Payment-Loan Repayment           67.9804913  -849.9946  985.95560
## Streaming Service-Loan Repayment     -52.5204022  -933.3477  828.30693
## Taxi Fare-Loan Repayment             159.5946916  -753.9416 1073.13099
## Water Bill-Loan Repayment            185.8568331  -713.6625 1085.37613
## Movie Ticket-Mobile Recharge         -49.4550017  -953.6783  854.76827
## Online Shopping-Mobile Recharge        5.3780086  -923.8472  934.60324
## Rent Payment-Mobile Recharge          48.0029900  -873.8192  969.82514
## Streaming Service-Mobile Recharge    -72.4979034  -957.3338  812.33799
## Taxi Fare-Mobile Recharge            139.6171904  -777.7848 1057.01914
## Water Bill-Mobile Recharge           165.8793318  -737.5656 1069.32426
## Online Shopping-Movie Ticket          54.8330103  -847.4151  957.08115
## Rent Payment-Movie Ticket             97.4579917  -797.1639  992.07984
## Streaming Service-Movie Ticket       -23.0429017  -879.5047  833.41886
## Taxi Fare-Movie Ticket               189.0721921  -700.9944 1079.13877
## Water Bill-Movie Ticket              215.3343335  -660.3396 1091.00831
## Rent Payment-Online Shopping          42.6249814  -877.2598  962.50979
## Streaming Service-Online Shopping    -77.8759120  -960.6933  804.94148
## Taxi Fare-Online Shopping            134.2391818  -781.2161 1049.69444
## Water Bill-Online Shopping           160.5013232  -740.9668 1061.96942
## Streaming Service-Rent Payment      -120.5008934  -995.5227  754.52088
## Taxi Fare-Rent Payment                91.6142004  -816.3257  999.55411
## Water Bill-Rent Payment              117.8763418  -775.9588 1011.71149
## Taxi Fare-Streaming Service          212.1150938  -658.2488 1082.47902
## Water Bill-Streaming Service         238.3772352  -617.2627 1094.01721
## Water Bill-Taxi Fare                  26.2621414  -863.0137  915.53799
##                                         p adj
## Education Fee-Bus Ticket            1.0000000
## Electricity Bill-Bus Ticket         0.9999999
## Flight Booking-Bus Ticket           0.9824317
## Food Delivery-Bus Ticket            0.9992996
## Gaming Credits-Bus Ticket           1.0000000
## Gas Bill-Bus Ticket                 0.4479335
## Gift Card-Bus Ticket                1.0000000
## Grocery Shopping-Bus Ticket         1.0000000
## Hotel Booking-Bus Ticket            1.0000000
## Insurance Premium-Bus Ticket        1.0000000
## Internet Bill-Bus Ticket            0.7551981
## Loan Repayment-Bus Ticket           0.9999999
## Mobile Recharge-Bus Ticket          0.9999994
## Movie Ticket-Bus Ticket             1.0000000
## Online Shopping-Bus Ticket          0.9999991
## Rent Payment-Bus Ticket             0.9999825
## Streaming Service-Bus Ticket        1.0000000
## Taxi Fare-Bus Ticket                0.9985506
## Water Bill-Bus Ticket               0.9956133
## Electricity Bill-Education Fee      0.9999971
## Flight Booking-Education Fee        0.9480591
## Food Delivery-Education Fee         0.9960031
## Gaming Credits-Education Fee        0.9999996
## Gas Bill-Education Fee              0.2756521
## Gift Card-Education Fee             1.0000000
## Grocery Shopping-Education Fee      1.0000000
## Hotel Booking-Education Fee         1.0000000
## Insurance Premium-Education Fee     1.0000000
## Internet Bill-Education Fee         0.5890439
## Loan Repayment-Education Fee        0.9999973
## Mobile Recharge-Education Fee       0.9999902
## Movie Ticket-Education Fee          0.9999996
## Online Shopping-Education Fee       0.9999856
## Rent Payment-Education Fee          0.9998202
## Streaming Service-Education Fee     0.9999999
## Taxi Fare-Education Fee             0.9927505
## Water Bill-Education Fee            0.9814724
## Flight Booking-Electricity Bill     0.9999896
## Food Delivery-Electricity Bill      1.0000000
## Gaming Credits-Electricity Bill     1.0000000
## Gas Bill-Electricity Bill           0.9165862
## Gift Card-Electricity Bill          0.9997768
## Grocery Shopping-Electricity Bill   1.0000000
## Hotel Booking-Electricity Bill      1.0000000
## Insurance Premium-Electricity Bill  0.9988068
## Internet Bill-Electricity Bill      0.9917641
## Loan Repayment-Electricity Bill     1.0000000
## Mobile Recharge-Electricity Bill    1.0000000
## Movie Ticket-Electricity Bill       1.0000000
## Online Shopping-Electricity Bill    1.0000000
## Rent Payment-Electricity Bill       1.0000000
## Streaming Service-Electricity Bill  1.0000000
## Taxi Fare-Electricity Bill          1.0000000
## Water Bill-Electricity Bill         0.9999999
## Food Delivery-Flight Booking        1.0000000
## Gaming Credits-Flight Booking       0.9999754
## Gas Bill-Flight Booking             0.9999961
## Gift Card-Flight Booking            0.8619947
## Grocery Shopping-Flight Booking     0.9894516
## Hotel Booking-Flight Booking        0.9960357
## Insurance Premium-Flight Booking    0.7748675
## Internet Bill-Flight Booking        1.0000000
## Loan Repayment-Flight Booking       0.9999910
## Mobile Recharge-Flight Booking      0.9999977
## Movie Ticket-Flight Booking         0.9999306
## Online Shopping-Flight Booking      0.9999983
## Rent Payment-Flight Booking         0.9999999
## Streaming Service-Flight Booking    0.9997102
## Taxi Fare-Flight Booking            1.0000000
## Water Bill-Flight Booking           1.0000000
## Gaming Credits-Food Delivery        1.0000000
## Gas Bill-Food Delivery              0.9973388
## Gift Card-Food Delivery             0.9749660
## Grocery Shopping-Food Delivery      0.9997128
## Hotel Booking-Food Delivery         0.9999557
## Insurance Premium-Food Delivery     0.9417494
## Internet Bill-Food Delivery         0.9999725
## Loan Repayment-Food Delivery        1.0000000
## Mobile Recharge-Food Delivery       1.0000000
## Movie Ticket-Food Delivery          1.0000000
## Online Shopping-Food Delivery       1.0000000
## Rent Payment-Food Delivery          1.0000000
## Streaming Service-Food Delivery     0.9999997
## Taxi Fare-Food Delivery             1.0000000
## Water Bill-Food Delivery            1.0000000
## Gas Bill-Gaming Credits             0.9032820
## Gift Card-Gaming Credits            0.9999391
## Grocery Shopping-Gaming Credits     1.0000000
## Hotel Booking-Gaming Credits        1.0000000
## Insurance Premium-Gaming Credits    0.9996055
## Internet Bill-Gaming Credits        0.9887157
## Loan Repayment-Gaming Credits       1.0000000
## Mobile Recharge-Gaming Credits      1.0000000
## Movie Ticket-Gaming Credits         1.0000000
## Online Shopping-Gaming Credits      1.0000000
## Rent Payment-Gaming Credits         1.0000000
## Streaming Service-Gaming Credits    1.0000000
## Taxi Fare-Gaming Credits            1.0000000
## Water Bill-Gaming Credits           0.9999996
## Gift Card-Gas Bill                  0.1872813
## Grocery Shopping-Gas Bill           0.5053192
## Hotel Booking-Gas Bill              0.5788559
## Insurance Premium-Gas Bill          0.1225681
## Internet Bill-Gas Bill              1.0000000
## Loan Repayment-Gas Bill             0.9222113
## Mobile Recharge-Gas Bill            0.9479875
## Movie Ticket-Gas Bill               0.8487426
## Online Shopping-Gas Bill            0.9522442
## Rent Payment-Gas Bill               0.9797478
## Streaming Service-Gas Bill          0.7642402
## Taxi Fare-Gas Bill                  0.9987506
## Water Bill-Gas Bill                 0.9994751
## Grocery Shopping-Gift Card          1.0000000
## Hotel Booking-Gift Card             0.9999999
## Insurance Premium-Gift Card         1.0000000
## Internet Bill-Gift Card             0.4397998
## Loan Repayment-Gift Card            0.9997924
## Mobile Recharge-Gift Card           0.9995301
## Movie Ticket-Gift Card              0.9999301
## Online Shopping-Gift Card           0.9993976
## Rent Payment-Gift Card              0.9968364
## Streaming Service-Gift Card         0.9999733
## Taxi Fare-Gift Card                 0.9627633
## Water Bill-Gift Card                0.9293691
## Hotel Booking-Grocery Shopping      1.0000000
## Insurance Premium-Grocery Shopping  1.0000000
## Internet Bill-Grocery Shopping      0.8031854
## Loan Repayment-Grocery Shopping     1.0000000
## Mobile Recharge-Grocery Shopping    0.9999999
## Movie Ticket-Grocery Shopping       1.0000000
## Online Shopping-Grocery Shopping    0.9999998
## Rent Payment-Grocery Shopping       0.9999953
## Streaming Service-Grocery Shopping  1.0000000
## Taxi Fare-Grocery Shopping          0.9993538
## Water Bill-Grocery Shopping         0.9978123
## Insurance Premium-Hotel Booking     0.9999979
## Internet Bill-Hotel Booking         0.8628316
## Loan Repayment-Hotel Booking        1.0000000
## Mobile Recharge-Hotel Booking       1.0000000
## Movie Ticket-Hotel Booking          1.0000000
## Online Shopping-Hotel Booking       1.0000000
## Rent Payment-Hotel Booking          0.9999998
## Streaming Service-Hotel Booking     1.0000000
## Taxi Fare-Hotel Booking             0.9998774
## Water Bill-Hotel Booking            0.9994523
## Internet Bill-Insurance Premium     0.3282489
## Loan Repayment-Insurance Premium    0.9988880
## Mobile Recharge-Insurance Premium   0.9978289
## Movie Ticket-Insurance Premium      0.9995270
## Online Shopping-Insurance Premium   0.9973262
## Rent Payment-Insurance Premium      0.9893836
## Streaming Service-Insurance Premium 0.9997759
## Taxi Fare-Insurance Premium         0.9197548
## Water Bill-Insurance Premium        0.8642528
## Loan Repayment-Internet Bill        0.9925095
## Mobile Recharge-Internet Bill       0.9961093
## Movie Ticket-Internet Bill          0.9784294
## Online Shopping-Internet Bill       0.9966458
## Rent Payment-Internet Bill          0.9992065
## Streaming Service-Internet Bill     0.9551514
## Taxi Fare-Internet Bill             0.9999919
## Water Bill-Internet Bill            0.9999983
## Mobile Recharge-Loan Repayment      1.0000000
## Movie Ticket-Loan Repayment         1.0000000
## Online Shopping-Loan Repayment      1.0000000
## Rent Payment-Loan Repayment         1.0000000
## Streaming Service-Loan Repayment    1.0000000
## Taxi Fare-Loan Repayment            1.0000000
## Water Bill-Loan Repayment           0.9999999
## Movie Ticket-Mobile Recharge        1.0000000
## Online Shopping-Mobile Recharge     1.0000000
## Rent Payment-Mobile Recharge        1.0000000
## Streaming Service-Mobile Recharge   1.0000000
## Taxi Fare-Mobile Recharge           1.0000000
## Water Bill-Mobile Recharge          1.0000000
## Online Shopping-Movie Ticket        1.0000000
## Rent Payment-Movie Ticket           1.0000000
## Streaming Service-Movie Ticket      1.0000000
## Taxi Fare-Movie Ticket              0.9999999
## Water Bill-Movie Ticket             0.9999983
## Rent Payment-Online Shopping        1.0000000
## Streaming Service-Online Shopping   1.0000000
## Taxi Fare-Online Shopping           1.0000000
## Water Bill-Online Shopping          1.0000000
## Streaming Service-Rent Payment      1.0000000
## Taxi Fare-Rent Payment              1.0000000
## Water Bill-Rent Payment             1.0000000
## Taxi Fare-Streaming Service         0.9999985
## Water Bill-Streaming Service        0.9999869
## Water Bill-Taxi Fare                1.0000000

Interpretation of ANOVA Results:

Since the p-value is 0.101, which is greater than 0.05, we fail to reject the null hypothesis.This means there is not enough evidence to conclude that the mean Final Amount Paid differs significantly across the 20 product categories. Based on this test, we do not find a statistically significant effect of product category on the Final Amount Paid at the 5% significance level.

Linear Regression Model: To analyze the influence of product_amount on the response variable final_amount_paid, we can build a linear regression model and evaluate its fit.

# Build linear regression model
linear_model <- lm(final_amount_paid ~ product_amount, data = data)

# Summary of the model to evaluate its fit
summary(linear_model)
## 
## Call:
## lm(formula = final_amount_paid ~ product_amount, data = data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -72.829 -24.777  -0.391  24.482  74.146 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)    -2.524e+01  9.010e-01  -28.02   <2e-16 ***
## product_amount  1.000e+00  1.571e-04 6365.63   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 32.04 on 4998 degrees of freedom
## Multiple R-squared:  0.9999, Adjusted R-squared:  0.9999 
## F-statistic: 4.052e+07 on 1 and 4998 DF,  p-value: < 2.2e-16

Residual = ObservedValue − PredictedValue

Interpretation: The residuals represent the differences between the observed values of final_amount_paid and the values predicted by your model. The range of residuals from -72.829 to 74.146 suggests that while most predictions are close to the actual values (as indicated by the median close to zero), there are a few instances where the model significantly over- or under-predicts the final amount paid.

Coefficients:

The estimated intercept of the model is \(-25.24\), indicating that when product_amount is zero, the predicted final_amount_paid is \(-25.24\). While this value is not practically meaningful, it establishes a baseline for the effect of product_amount. The coefficient for product_amount is \(1.00\), meaning that for each additional dollar increase in product_amount, the final_amount_paid increases by approximately \(1.00\). The associated p-value \(< 2e-16\) indicates this coefficient is statistically significant, making product_amount a reliable predictor of final_amount_paid.

Model Fit:

The residual standard error is \(32.04\), suggesting a good fit of the model to the data. The multiple R-squared value is \(0.9999\), meaning that about \(99.99\%\) of the variance in final_amount_paid can be explained by product_amount, and the adjusted R-squared also being \(0.9999\) confirms that the model effectively accounts for variance even with a single predictor. Finally, the F-statistic of \(4.052e+07\) with a p-value \(< 2.2e-16\) indicates that the model as a whole is statistically significant, reflecting a strong relationship between product_amount and final_amount_paid.

Summary of Insights

Strong Relationship: The very high R-squared value indicates a strong relationship between product_amount and final_amount_paid, making product_amount a critical factor for predicting how much a user will pay in the end.

Predictive Power: The coefficient for product_amount suggests that increasing the amount spent on products directly increases the final amount paid by the same amount, which could inform pricing and marketing strategies.

Model Significance: Both the individual predictors and the overall model are statistically significant, which adds confidence to the conclusions drawn from this analysis.

Recommendations Based on the analysis: Consider optimizing the product_amount as it has a direct and significant effect on the final_amount_paid. Pricing strategies that increase the product amount might lead to higher final payments.

Further Investigations: I will investigate other potential explanatory variables (e.g., transaction fees, cashback) to see how they interact with product_amount. Additionally, examining non-linear relationships or interactions between variables might provide deeper insights.