Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

In the MinnLand dataset in the alr4 package, fit two possible models with log(acrePrice) or sqrt(acrePrice) as the response (y) variable and your choice of independent (x) variables. Be sure to...

2 answer below »
In the MinnLand dataset in the alr4 package, fit two possible models with log(acrePrice) or sqrt(acrePrice) as the response (y) variable and your choice of independent (x) variables. Be sure to explain why you chose the variables that you did (and the help file has great descriptions of the data). Develop those two possible candidate models (bothlog(acrePrice) or sqrt(acrePrice)) and compare them using:

10 Fold Cross Validation
20 Fold Cross Validation

Random Splitting with 1000 splits.
Answered 1 days After Sep 30, 2022

Solution

Himanshu answered on Oct 01 2022
58 Votes
Assignment 112062
Assignment 112062
In the MinnLand dataset in the alr4 package, fit two possible models with log(acrePrice) or sqrt(acrePrice) as the response variable and your choice of independent variables. We will be using log(acrePrice) in this exercise. Note that the interpretations won’t change even if we used sqrt(acrePrice).
Let us start the exercise by importing the required packages, i.e. alr4 and caret. The package caret is used for cross validation.
m(list=ls(all=TRUE))
li
ary(alr4)
## Loading required package: ca
## Loading required package: carData
## Loading required package: effects
## lattice theme set by effectsTheme()
## See ?effectsTheme for details.
li
ary(caret)
## Loading required package: ggplot2
## Loading required package: lattice
The first regression model we fit is between log(acrePrice) and year. It is well known that the land prices increases with time. This model can help us to confirm that notion.
## Regression between log(acrePrice) and yea
plot(as.factor(MinnLand$year), MinnLand$acrePrice, xlab = "Year",
ylab = "Sale Price in Dollars per Acre",
main = "year vs. acrePrice")
lm(log(MinnLand$acrePrice) ~ as.factor(MinnLand$year))
##
## Call:
## lm(formula = log(MinnLand$acrePrice) ~ as.factor(MinnLand$year))
##
## Coefficients:
## (Intercept) as.factor(MinnLand$year)2003
## 7.27175 -0.00155
## as.factor(MinnLand$year)2004 as.factor(MinnLand$year)2005
## 0.14794 0.36026
## as.factor(MinnLand$year)2006 as.factor(MinnLand$year)2007
## 0.39392 0.47682
## as.factor(MinnLand$year)2008 as.factor(MinnLand$year)2009
## 0.68364 ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here