Subject: Marketing Analytics II – Regression Analysis (RStudio) My… Subject: Marketing Analytics II – Regression Analysis (RStudio)My code so far:—title: “Homework on Media Mix Modeling“author: “Nicole-Lourdes Fader”output: pdf_document: default html_notebook: default html_document: default—In this homework, with help from the following code, you are going to estimate 9 models using different values of $lambda$ with the estimation data, and using the test data to select the best model.Please replace “……” with your own code, no need to change any exisiting code.## First, Load the Data and Get ReadyFinish the code of loading the data file called “sales_ads_use.csv”, using command `read.csv()`, and name the data frame as `cardf““{r }datafile <- read.csv("sales_ads_use.csv")cardf <- df ```## Second, Create the Ad-Stock VariablesThe code below provides a function for a matrix of ad-stock variables from a matrix of the original per-period marketing variables as the data reads.```{r }# AdStockMatrix() Returns the scale matrix for creating the adstock variable from the marketing per-period expenses# Input: # lambda - the discounted value# MM - the matrix with all the marketing variablesAdStockMatrix <- function(lambda, MM) { n=nrow(MM) r <- lambda^(seq_len(n)-1) m <- matrix(rep(r,n),nrow=n) z <- matrix(0,nrow=n,ncol=n) z[lower.tri(z,diag=TRUE)] <- m[row(m) <= (n+1-col(m))] GG <- z %*% MM GG}``` Question 1(a): I don't know how to estimate the regression model with different ad-stock variable matrices from different $lambda$ values. How do I draw that using the 'lm()' function 9 times?Image transcription text## Third, Estimate the Nine RegressionModels Estimate the regression modelwith different ad-stock var... Show more... Show more Question 1(b): From there, what is the code to determine the highest value of $R^2$?Image transcription text## Finally, list the $R^2$ values fromthe 9 different models Which one hasthe highest value of $R^2... Show more... Show more Arts & Humanities Communications Marketing MKTG 3738
You will get a plagiarism-free paper and you can get an originality report upon request.
All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more