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)
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.
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.
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.
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.
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.
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?
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))
}
Use boot() function to conduct bootstapping and produce boot object for the appropriate multiple regression model. Summary the results.
Plot the boot object including the histogram and quantiles of standard normal for each of the multiple regression coefficient parameters.
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.
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
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
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme