logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Marshall HildrethLaw
(5/5)

892 Answers

Hire Me
expert
Richard RusselllEngineering
(5/5)

613 Answers

Hire Me
expert
Henry SimmonsEnglish
(5/5)

896 Answers

Hire Me
expert
Mason RamirezSociology
(5/5)

541 Answers

Hire Me
R Programming
(5/5)

Create a scatter plot displaying the sales units versus youtube, Facebook, and newspaper advertising budget, respectively. Add a smoothed line.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Assignment  R  Project

Please note, each student should submit his/her own R project since we suspend in-person classes. The weight of this R project will be re-determined and updated. I may adjust the weight from 10% to 20%.

We use the marketing data set (R package sanitarium). It contains the impact of three advertising media (youtube, Facebook, and newspaper) on sales. Data is the advertising budget in thousands of dollars along with the sales. The advertising experiment has been repeated 200 times with different budgets and the observed sales have been recorded. The following packages are the necessary ones. Please install them if you do not have installed them before. 

library(tidyverse)

## ── Attaching packages ───────────────────────────────── tidyverse 1.2.1 ──
## ✓ ggplot2 3.2.1     ✓ purrr   0.3.3
## ✓ tibble  2.1.3     ✓ dplyr   0.8.3
## ✓ tidyr   1.0.0     ✓ stringr 1.4.0
## ✓ readr   1.3.1     ✓ forcats 0.4.0
## ── Conflicts ──────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
library(ggpubr)
## Loading required package: magrittr
## 
## Attaching package: 'magrittr'
## The following object is masked from 'package:purrr':
## 
##     set_names
## The following object is masked from 'package:tidyr':
## 
##     extract
library(datarium)
library(boot)
  1. Visualize the first 6 rows and last 6 rows of the dataset. Draw histogram and boxplot of each variable. Calculate the five-number summary and identify possible outliers of each variable.

  2. Create a scatter plot displaying the sales units versus youtube, Facebook, and newspaper advertising budget, respectively. Add a smoothed line. Compute the correlation and interpret.

  3. Find the least squares regression line for the following data: sales versus youtube, sales versus facebook, and sales versus newspaper, respectively. From each output, write out the least squares regression equation, R squared and adjusted R squared. Interpret each least squares regression equation and R squared.

  4. Build a mutiple linear regression model (additive model) that predicts the sales units on the basis of youtube, facebook and newspaper advertising budget. Find out the insignificant predictor(s) in the multiple regression model and interpret.

  5. Using the significant predictors in question 4, build the appropriate multiple linear model. From the output, write down the regression equation, multiple R squared and asjusted R squared.

  6. Using the regression equation in question 5 (the significan predictors are youtube and facebook), find the 95% confidence interval for the conditional population mean sale units \(\mu_{Y|x}\) when youtube advertising budget is 350 and facebook advertising budget is 55. Find the prediction Interval for the new sale units \(Y\) when youtube advertising budget is 350 and facebook advertising budget is 55. Which interval is wider?

  7. Create a funtion called “myRegCoef” to compute the estimates of the mutiple linear regression coefficients using the significant predictors to use in the boot() function. I suggest you to use glm() function to build the multiple regression model instead of lm(). The R code could be:

model2 <- glm(formula = sales ~ youtube + facebook, data = marketing)
myRegCoef <- function(data, indices, formula) {
  d <- data[indices,]
  fit <- glm(formula, data=d)
  return(coef(fit))
}
  1. Use boot() function to conduct bootstapping and produce boot object for the appropriate multiple regression model. Summary the results.

  2. Plot the boot object including the histogram and quantiles of standard normal for each of the multiple regression coefficient parameters.

  3. Compute 95% boostrap confidence intervals for each of the multiple regression coefficient parameters. Calculate 95% confidence intervals for each of the bootstrapped R-squared values using ``Basic" method.

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme