## 
## Call:
## lm(formula = Revenue ~ Spend)
## 
## Coefficients:
## (Intercept)        Spend  
##   1.346e+05    1.091e+00
## 
## Call:
## lm(formula = Revenue ~ Spend)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -322296  -61120    1873   59363  336863 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 1.346e+05  3.737e+04    3.60 0.000379 ***
## Spend       1.091e+00  6.106e-02   17.86  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 95930 on 264 degrees of freedom
## Multiple R-squared:  0.5473, Adjusted R-squared:  0.5456 
## F-statistic: 319.2 on 1 and 264 DF,  p-value: < 2.2e-16
##        fit      lwr     upr
## 1 820262.1 630999.5 1009525
##        fit      lwr      upr
## 1 820262.1 808321.9 832202.4

###Using the R built-in R functions, we arrive at the same results as the functions programmed from scratch (This is a personal note. The report begins below###

The plots above show that the assumptions of linearity, normality, and homoscedasticity hold and our model is valid for the claims below:

Lets explore the relationship between advertising spending and revenue. The summary of our model above produces an R-Squared value of 0.5456, which by metrics of the finance discipline is pretty weak. Running the same analysis on a subset of the data from [500000 , 700000] yields an even weaker correlation. The analysis of the subset isn’t wasignificant(model isnt great after looking at residual plots) but i thought it would be
interesting to look at. That is to say, even in a weaker statistical analysis wouldn’t yield
optimistic results.

## 
## Call:
## lm(formula = Spend ~ Revenue, data = range)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -96768 -32359   2367  33046 111960 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 4.075e+05  2.382e+04  17.104  < 2e-16 ***
## Revenue     2.477e-01  3.019e-02   8.205 3.56e-14 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 45720 on 188 degrees of freedom
## Multiple R-squared:  0.2637, Adjusted R-squared:  0.2598 
## F-statistic: 67.33 on 1 and 188 DF,  p-value: 3.558e-14

Returning to sound analysis, we see that the confidence interval is [630999.5 , 1009525], which suggests that average money spent on advertising ($820262.1) yields a revenue between 630999.5 and 1009525 95% of the time. So a company who wants to spend between $500-700k will be ill-guided according to this analysis, as they are not spending near the average. More analysis would need to be done to evaluate the efficiency of spending 500-700k specifically. I would urge that companies looking to spend money on advertising, otherwise they likely wont see a return on their investment. AND if they do see a return, it is very small. In sum, I would not recommend spending this much on advertising because it really seems like tossup on the return, especially given the weak to moderate correlation value.

plot(Spend, Revenue)
abline(model)