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 (both
log(acrePrice) or sqrt(acrePrice)
) and compare them using:




10 Fold Cross Validation

20 Fold Cross Validation





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

Answer To: In the MinnLand dataset in the alr4 package, fit two possible models with log(acrePrice) or...

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 cho
ice 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.
rm(list=ls(all=TRUE))
library(alr4)
## Loading required package: car
## Loading required package: carData
## Loading required package: effects
## lattice theme set by effectsTheme()
## See ?effectsTheme for details.
library(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 year
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