library(readr)
Develop an estimated simple linear regression equation to predict the weekly gross revenue from the amount of television advertising.
movie<-read.csv("movie.csv")
head(movie)
## revenue television newspaper
## 1 96 5.0 1.5
## 2 90 2.0 2.0
## 3 95 4.0 1.5
## 4 92 2.5 2.5
## 5 95 3.0 3.3
## 6 94 3.5 2.3
model<-lm(revenue~television, data=movie)
summary(model)
##
## Call:
## lm(formula = revenue ~ television, data = movie)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.8454 -0.6498 -0.1522 0.7512 1.5507
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 88.6377 1.5824 56.016 2.17e-09 ***
## television 1.6039 0.4778 3.357 0.0153 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.215 on 6 degrees of freedom
## Multiple R-squared: 0.6526, Adjusted R-squared: 0.5946
## F-statistic: 11.27 on 1 and 6 DF, p-value: 0.01529
cor.test(movie$television, movie$revenue, method="pearson")
##
## Pearson's product-moment correlation
##
## data: movie$television and movie$revenue
## t = 3.3569, df = 6, p-value = 0.01529
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.2394245 0.9638298
## sample estimates:
## cor
## 0.8078074
The estimated simple linear regression equation is Y = 88.6377 + 1.6039X.
Interpret the regression coefficients and check their significance in the model.
From the equation, the weekly gross revenue will increase by around 1,603.9 dollars for every thousand dollar increase in price. The intercept (88.6377) means that a weekly gross revenue of 88,637.7 dollars will still be made without spending on television advertising.
Furthermore, the reported p-value for the model is lesser than the 0.05 significance level, hence this implies that the model is significant. It can be used to predict weekly gross revenue based on the cost television advertising expenditures.
What do the values of r and r^2 say about the association between the variables?
There is a very strong positive correlation between the revenue and television advertising expense of the company as indicated by the correlation coefficient value of 0.8078. As the expenses for television advertising increase, the gross revenue is expected to increase.
The coefficient of determination is 0.6526 which means that 65.26% of the total variation in the gross revenue can be explained by the linear relationship between the television advertising expense and the weekly gross revenue.
Develop an estimated multiple linear regression equation to predict the weekly gross revenue with both television advertising and newspaper advertising as the independent variables.
model1<-lm(revenue~television+newspaper, data=movie)
summary(model1)
##
## Call:
## lm(formula = revenue ~ television + newspaper, data = movie)
##
## Residuals:
## 1 2 3 4 5 6 7 8
## -0.6325 -0.4124 0.6577 -0.2080 0.6061 -0.2380 -0.4197 0.6469
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 83.2301 1.5739 52.882 4.57e-08 ***
## television 2.2902 0.3041 7.532 0.000653 ***
## newspaper 1.3010 0.3207 4.057 0.009761 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.6426 on 5 degrees of freedom
## Multiple R-squared: 0.919, Adjusted R-squared: 0.8866
## F-statistic: 28.38 on 2 and 5 DF, p-value: 0.001865
The estimated multiple linear regression equation is Y = 83.2301 + 2.2902X1 + 1.3010X2.
Interpret the regression coefficients and assess their significance in the model.
If the weekly expense for newspaper advertising is held constant, the gross revenue will increase by around 2,290.2 dollars for every thousand dollar increase in television advertising expenditure. On the other hand, if the weekly expense for television advertising is held constant, increasing the expense for newspaper advertising by a thousand dollar will increase the weekly gross revenue by around 1,301 dollars. The intercept (83.2301) means that a weekly gross revenue of 83,230.10 dollars will still be made without the expense on both newspaper and television advertising.
Futhermore, the reported p-value for the model is lesser than the 0.05 significance level, hence, this implies that the model is significant. It can be used to predict or estimate the weekly gross revenue of the movie theater based on both television and newspaper advertising expenditures.
What does the adjusted r2 say about the association between the variables?
The adjusted R-squared value of 0.8866 implies that 88.66% of the variation in weekly gross revenue is explained by the linear relationship between the weekly gross revenue and the independent variables, television and newspaper advertising expenditures.
What can you say about the estimated regression equation coefficient for television advertising expenditures from (a) and (b)? Interpret.
The estimated regression coefficient for television advertising expenditures increased from 1.6039 to 2.2902. This means that the increase effect of every thousand dollar spent in television advertising to the weekly gross revenue is around 686.3 dollars higher when an additional expense on newspaper advertising is considered than when it is not.
What is the estimated weekly gross revenue for a week when 3500 dollars is spent on television advertising and 1800 dollars is spent on newspaper advertising?
83.2301+(2.2902*3.5)+(1.3010*1.8)
## [1] 93.5876
The estimated weekly gross revenue is $93,587.60.