Question

In: Statistics and Probability

[USING R & dataset “Boston”] Using the leave-one-out cross-validation and 5-fold cross-validation techniques to compare the...

[USING R & dataset “Boston”] Using the leave-one-out cross-validation and 5-fold cross-validation techniques to compare the performance of models in (a) and (b) with:

(a) SalesPredict <- lm(Sales ~ Price + Urban + US, data = Carseats)

(b) SalesRevise <- lm(Sales ~ Price + US, data = Carseats)

Hint: Functions update (with option subset) and predict.

Solutions

Expert Solution

When Use method LOOVC(Leave one out cross validation) and 5-fold Cross Validation.

5-fold Cross Validation gives more Rsquare value comparison to LOOVC method.

According to anlaysis 5-Fold Cross Validation is good from LOOVC method.


Related Solutions

how do you compute the test error in 5-fold cross-validation?
how do you compute the test error in 5-fold cross-validation?
Cross validation: If we perform k-fold cross validation, training a Naive Bayes model, how many models...
Cross validation: If we perform k-fold cross validation, training a Naive Bayes model, how many models will we end up creating?
How does the computational time changes when we decrease the k in k-fold cross validation? Why?...
How does the computational time changes when we decrease the k in k-fold cross validation? Why? Explain. b. In which procedures, we can apply k-fold cross validation. Consider all the procedures that we learned.
ANSWER USING R CODE Using the dataset 'LakeHuron' which is a built in R dataset describing...
ANSWER USING R CODE Using the dataset 'LakeHuron' which is a built in R dataset describing the level in feet of Lake Huron from 1872- 1972. To assign the values into an ordinary vector,x, we can do the following 'x <- as.vector(LakeHuron)'. From there, we can access the data easily. Assume the values in X are a random sample from a normal population with distribution X. Also assume the X has an unknown mean and unknown standard deviation. With this...
Fitting a linear model using R a. Read the Toluca.txt dataset into R (this dataset can...
Fitting a linear model using R a. Read the Toluca.txt dataset into R (this dataset can be found on Canvas). Now fit a simple linear regression model with X = lotSize and Y = workHrs. Summarize the output from the model: the least square estimators, their standard errors, and corresponding p-values. b. Draw the scatterplot of Y versus X and add the least squares line to the scatterplot. c. Obtain the fitted values ˆyi and residuals ei . Print the...
5. a. Analyze the Bread variable in the SandwichAnts dataset using aov() in R and interpret...
5. a. Analyze the Bread variable in the SandwichAnts dataset using aov() in R and interpret your results. The data may be found here: install.packages("Lock5Data") library(Lock5Data) data(SandwichAnts,package="Lock5Data") attach(SandwichAnts) b. State the linear model for this problem. Define all notation and model terms. c. Create the design matrix for this problem. d. Estimate model parameters for this problem using ? = (?T?)-1?T? e. Interpret the meaning of the estimates from part d. f. Rerun this problem using lm()in R. Interpret the...
Boston Duck Tours is a firm that offers one-hour tours of the city of Boston using...
Boston Duck Tours is a firm that offers one-hour tours of the city of Boston using replica World War II amphibious vehicles. Suppose the wage for each employee is $20/hour and the amphibious vehicle rental rate is $100/hour. Each tour is staffed by one employee (who drives and narrates during the tour). (a) Draw the set of isoquants that describe Boston Duck Tours’ production function for tours. (b) Draw the set of isocosts that Boston Duck Tours faces. (c) Find...
Using dataset "PlantGrowth" in R (r code) Construct a 95% confidence interval for the true mean...
Using dataset "PlantGrowth" in R (r code) Construct a 95% confidence interval for the true mean weight. Interpret the confidence interval in in the context of the problem.
R has many build-in dataset. The data mtcars is one of them. The following R code...
R has many build-in dataset. The data mtcars is one of them. The following R code read-in data and save the data to input.                   input <- mtcars[,c("am","cyl","hp","wt")]              Write a few line of R code to conduct a regression analysis with am as the response variable, and              cyl, hp, wt as explanation variables.
Solve it by R Use the “d_logret_6stocks” dataset to answer the questions. Test by using α=...
Solve it by R Use the “d_logret_6stocks” dataset to answer the questions. Test by using α= .01. (General Motor: GenMotor). (1) Regress the return of General Motor on the returns of Citigroup (with intercept). Report the estimated coefficients. Is there any evidence to show strong linear relationship between these two variables at significance level 5%? (2) Suppose we “know” the return of Citigroup tomorrow is 0.05, what is the predicted return of General Motor tomorrow? (3) Compute the correlation of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT