I am trying to build a model in R to predict Conversion Rate.
So, the model below:
library(caret)
set.seed(100)
TrainIndex <- sample(1:nrow(data), 0.8*nrow(data))
data.train <- data[TrainIndex,]
data.test <- data[-TrainIndex,]
nrow(data.test)
model <- lm(CR ~ age+ gender + fact_interest + fact_xyz_campaign_id + age:gender , data=data.train)
will not have a good adjusted r-squared (0.04):
Call:
lm(formula = CR ~ age + gender + fact_interest + fact_xyz_campaign_id +
age:gender, data = data.train)
Residuals:
Min 1Q Median 3Q Max
-27.327 -10.606 -4.389 1.712 90.329
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 15.7126 6.7187 2.339 0.019581 *
age35-39 2.4407 2.8559 0.855 0.393002
age40-44 -3.8775 2.8716 -1.350 0.177274
age45-49 -2.4614 2.6736 -0.921 0.357494
genderM 3.4636 2.3296 1.487 0.137436
fact_interest7 -5.0387 7.1947 -0.700 0.483909
fact_interest10 3.4767 6.1014 0.570 0.568950
fact_interest15 5.3734 6.4681 0.831 0.406342
fact_interest16 -0.3113 5.8971 -0.053 0.957913
fact_interest18 1.0352 6.7091 0.154 0.877405
fact_interest19 5.1792 6.7937 0.762 0.446059
fact_interest20 1.4886 6.4909 0.229 0.818663
fact_interest21 0.9513 6.7828 0.140 0.888497
fact_interest22 -1.4520 6.8222 -0.213 0.831511
fact_interest23 -5.5979 7.2095 -0.776 0.437690
fact_interest24 2.8532 7.1828 0.397 0.691303
fact_interest25 -1.6134 7.2790 -0.222 0.824633
fact_interest26 -4.4335 6.6683 -0.665 0.506314
fact_interest27 -0.7451 6.2913 -0.118 0.905751
fact_interest28 5.0277 6.5291 0.770 0.441486
fact_interest29 2.9637 6.1361 0.483 0.629225
fact_interest30 -5.5094 7.1835 -0.767 0.443317
fact_interest31 8.1505 7.2712 1.121 0.262630
fact_interest32 9.3286 6.9570 1.341 0.180308
fact_interest36 -1.9311 7.4236 -0.260 0.794821
fact_interest63 2.6956 6.6486 0.405 0.685253
fact_interest64 -0.8879 6.4072 -0.139 0.889811
fact_interest65 10.6108 8.0674 1.315 0.188767
fact_interest66 -0.3091 8.4337 -0.037 0.970773
fact_interest100 -1.0102 10.9944 -0.092 0.926811
fact_interest101 21.0835 10.2688 2.053 0.040356 *
fact_interest102 10.0960 9.7438 1.036 0.300425
fact_interest103 1.2078 16.0312 0.075 0.939960
fact_interest104 20.0581 11.0045 1.823 0.068689 .
fact_interest105 -4.4382 13.4331 -0.330 0.741184
fact_interest106 0.1643 11.9851 0.014 0.989068
fact_interest107 0.3466 9.7365 0.036 0.971608
fact_interest108 1.2449 12.0004 0.104 0.917398
fact_interest109 0.6469 11.9954 0.054 0.957004
fact_interest110 2.8295 10.9817 0.258 0.796733
fact_interest111 0.2209 10.9821 0.020 0.983960
fact_interest112 1.1079 10.2833 0.108 0.914232
fact_interest113 1.9598 10.9944 0.178 0.858567
fact_interest114 -0.4277 12.0009 -0.036 0.971578
fact_xyz_campaign_id936 -4.7058 3.6280 -1.297 0.194952
fact_xyz_campaign_id1178 -13.5117 3.6365 -3.716 0.000216 ***
age35-39:genderM -1.3838 3.9013 -0.355 0.722908
age40-44:genderM 3.6620 4.0497 0.904 0.366112
age45-49:genderM -2.0268 3.8028 -0.533 0.594175
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
Residual standard error: 21.21 on 865 degrees of freedom
Multiple R-squared: 0.09209, Adjusted R-squared: 0.04171
F-statistic: 1.828 on 48 and 865 DF, p-value: 0.0006598
So, based on the provided information, is there any way to improve the model? what other models shall I try besides linear models to make sure that I have a good predictive model?
UPDATE1: you spend money to FB to show the ad. Impressions are the number of time the ad was shown, Clicks are the number of clicks on a specific ad. the company xyz has run 3 campaigns in total (xyz_campaign_id helps to identify between them). Interests are categorical variables (e.g. interest 2 might mean that the ad is targeting people who are interested in apple). Now, I myself am not too sure about the Approved_Conversion vs CR. The goal is to predict (Approved_Conversions/Clicks) CR. CR gives you a rate, it makes more sense to predict such a rate to know which audience segment to focus on (e.g. younger men with specific interests, etc.). If we predict approved_conversion, we also need to consider clicks, impressions or spent, but considering how the process works, it might not make sense (e.g. we dont know the clicks or spent before we run the ad)