Q2: Please perform a regression analysis using both Excel and R. Interpret your results (P value, R square, coefficients, etc.). For interpretation purposes, please make sure to refer to the reading (Reading - 3.1- 3.2 - Linear Regression (download the 2nd edition - free PDF book - Chapter 3) posted in Week 5. Assume that you work for this company. What are the marketing implications?

library(readr)
dat <- read_csv("abtesting.csv")
## Rows: 38 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (2): Ads, Purchase
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
dat$Ads <- factor(dat$Ads, levels = c(0,1))
summary(lm(Purchase ~ Ads, data = dat))
## 
## Call:
## lm(formula = Purchase ~ Ads, data = dat)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -57.000 -23.250   3.071  22.643  51.000 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   95.429      6.441  14.816  < 2e-16 ***
## Ads1          41.571      9.630   4.317 0.000118 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 29.52 on 36 degrees of freedom
## Multiple R-squared:  0.3411, Adjusted R-squared:  0.3228 
## F-statistic: 18.64 on 1 and 36 DF,  p-value: 0.0001184

Q4: Perform an AB test using the dataset ab_test.csv and explain your results. Please include both the Excel solution and the R Markdown solution.

library(readr)
dat <- read_csv("ab_testing.csv")
## Rows: 80 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (2): Ads, Purchase
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
dat$Ads <- factor(dat$Ads, levels = c(0,1))
summary(lm(Purchase ~ Ads, data = dat))
## 
## Call:
## lm(formula = Purchase ~ Ads, data = dat)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -50.095 -29.881  -5.095  27.369  65.905 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   55.381      7.065   7.839 1.31e-09 ***
## Ads1          75.714      9.991   7.578 2.97e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 32.37 on 40 degrees of freedom
##   (38 observations deleted due to missingness)
## Multiple R-squared:  0.5894, Adjusted R-squared:  0.5792 
## F-statistic: 57.43 on 1 and 40 DF,  p-value: 2.975e-09