Social Network Ads
Mục Lục
Social Network Ads
Madhurish Gupta
1. Introduction
Social network advertising, also social media targeting, is a group of terms that are used to describe forms of online advertising that focus on social networking services. One of the major benefits of this type of advertising is that advertisers can take advantage of the users’ demographic information and target their ads appropriately.Advantages are advertisers can reach users who are interested in their products, allows for detailed analysis and reporting, information gathered is real, not from statistical projections, does not access IP-addresses of the users.
2. Overview of the Study
Our field study concerns the dependence of purchase of product on gender , age , estimated salary of a person with given userID.
3. An empirical field study of Social Network ads
3.1 Overview
The specific objective of this Study was to investigate the advertising strategy employed by company to which group of people they must advertise more. Our goal was to compare purchasing of the product by person based on sex , age and estimated salary.
Accordingly, we construct the following hypothesis:
Hypothesis H1: The number of males who purchased the product are more than number of females who purchased the product
3.2 Data
For this study, we collected data from trusted website.
Data contains 5 columns.
-
UserID – Each person has a unique ID from which we can identify the person uniquely.
-
Gender – Person can male or female. This field is very important for our hypothesis.
-
Age – Age of the person. Because our product can be useful to some ages only.
-
EstimatedSalary – This column contains salary of a person as salary can affect the shopping of a person.
-
Purchased – Contains two numbers ‘0’ or ‘1’. ‘0’ means not purchased and ‘1’ means purchased.This variable is our dependent variable.
3.3 Model
In order to test Hypothesis , we proposed the following model:
\[Purchased = \alpha_0 + \alpha_1 Gender + \alpha_2 Age + \alpha_3 EstimatedSalary + \epsilon\]
# Read the data
dataset <- read.csv('Social_Network_Ads.csv')
attach(dataset)
# OLS Model
# Replace the 'sex' columns as follows: 1 = Male, 2 = Female
# Convert them both into factors
dataset$Gender[dataset$Gender == 1] <- 'Male'
dataset$Gender[dataset$Gender == 2] <- 'Female'
dataset$Gender <- factor(dataset$Gender)
linearMod <- lm(Purchased ~ Gender + Age + EstimatedSalary, data=dataset)
summary(linearMod)
##
## Call:
## lm(formula = Purchased ~ Gender + Age + EstimatedSalary, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.00533 -0.28014 -0.03037 0.25799 0.86629
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -9.352e-01 6.788e-02 -13.778 < 2e-16 ***
## GenderMale 3.232e-02 3.166e-02 1.021 0.308
## Age 2.850e-02 1.530e-03 18.627 < 2e-16 ***
## EstimatedSalary 3.118e-06 4.622e-07 6.746 4.12e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3563 on 511 degrees of freedom
## Multiple R-squared: 0.4565, Adjusted R-squared: 0.4533
## F-statistic: 143.1 on 3 and 511 DF, p-value: < 2.2e-16
We established the effect of age , gender , estimated salary on the purchase of a product with the model. We regressed Purchase on Age , Gender , EstimatedSalary. We estimated model, using linear least squares.
3.4 Results
We found empirical support for Hypothesis. The number of males who purchased the product are more than number of females who purchased the product.
4. Conclusion
This paper was motivated by the need for research that could improve our understanding of how social advertising can affect the purchase of product based on age, gender and estimated salary of a person. The unique contribution of this paper is that we investigated the number of males and females who purchased the product through social network advertisements. We observed the number of males are larger than females who purchased the product.
Appendix 1
Descriptive statistics
# Summarize the Data
library(psych)
describe(dataset)
vars n mean sd median trimmed
User.ID 1 515 15689466.94 71282.69 15692819 15688984.03
Gender* 2 515 1.50 0.50 1 1.50
Age 3 515 37.60 10.38 37 37.36
EstimatedSalary 4 515 68100.97 34416.90 65000 65464.89
Purchased 5 515 0.37 0.48 0 0.33
mad min max range skew kurtosis se
User.ID 91417.12 15566689 15815236 248547 0.01 -1.18 3141.09
Gender* 0.00 1 2 1 0.01 -2.00 0.02
Age 11.86 18 60 42 0.17 -0.68 0.46
EstimatedSalary 32617.20 15000 150000 135000 0.54 -0.42 1516.59
Purchased 0.00 0 1 1 0.56 -1.69 0.02
One Way Contingency Table
mytable <- xtabs(~ Gender+Purchased, data=dataset)
mytable
## Purchased
## Gender 0 1
## Female 159 100
## Male 168 88
BoxPlot
boxplot(Purchased ~ EstimatedSalary , data=dataset)
boxplot(Purchased ~ Age , data=dataset)
Histograms
a <- dataset$Purchased
hist( a , data = dataset,
main = "Distrution of Purcahsed", xlab="Purchased or Not", col='grey' )
## Warning in plot.window(xlim, ylim, "", ...): "data" is not a graphical
## parameter
## Warning in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...):
## "data" is not a graphical parameter
## Warning in axis(1, ...): "data" is not a graphical parameter
## Warning in axis(2, ...): "data" is not a graphical parameter
b <- dataset$Age
hist( b , data = dataset, main = "Distrution of Age", xlab="Different Ages", col='blue' )
## Warning in plot.window(xlim, ylim, "", ...): "data" is not a graphical
## parameter
## Warning in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...):
## "data" is not a graphical parameter
## Warning in axis(1, ...): "data" is not a graphical parameter
## Warning in axis(2, ...): "data" is not a graphical parameter
c <- dataset$EstimatedSalary
hist( c , data = dataset,
main = "Distrution of EstimatedSalaries", xlab="Different Salaries ", col='green' )
## Warning in plot.window(xlim, ylim, "", ...): "data" is not a graphical
## parameter
## Warning in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...):
## "data" is not a graphical parameter
## Warning in axis(1, ...): "data" is not a graphical parameter
## Warning in axis(2, ...): "data" is not a graphical parameter
Correlation matrix
library(corrgram)
## Warning: package 'corrgram' was built under R version 3.4.3
corrgram(dataset, order=TRUE, lower.panel=panel.shade,
upper.panel=panel.pie, text.panel=panel.txt,
main="MBA Starting Salaries")
Correlation matrix using corrgram
library(corpcor)
library(tseries)
## Warning: package 'tseries' was built under R version 3.4.3
data_mat <- as.matrix(dataset[,3:5])
covmat = cov(data_mat)
cov2cor(covmat)
## Age EstimatedSalary Purchased
## Age 1.0000000 0.1241452 0.6387109
## EstimatedSalary 0.1241452 1.0000000 0.2954804
## Purchased 0.6387109 0.2954804 1.0000000
ScatterPlot Matrix
library(car)
## Warning: package 'car' was built under R version 3.4.3
##
## Attaching package: 'car'
## The following object is masked from 'package:psych':
##
## logit
scatterplotMatrix( formula = ~ Gender + Age + EstimatedSalary + Purchased , cex = 0.6 , data = dataset)