本次美国代写主要为R语言统计与分析相关的homework

Situation: Suppose that (again) you are interested in purchasing a used car. How much should you expect to pay? Obviously the price will depend on the type of car you get (the model) and how much it’s been used. For this assignment you will investigate how the price might depend on the age and mileage, as well as the state where thecar is purchased.

Data Source: To get a sample of cars, begin with the UsedCars CSV file. The data was acquired by scraping TrueCar.com for used car listings on 9/24/2017 and contains more than 1.2 million used cars. For this assignment you should choose the same car Model and State that you initially chose for homework #2. You should again add a variable called Age which is 2017-year (since the data was scraped in 2017).

Directions: The code below can again be used to select data from a particular Model and State of your choice.
The R chunk below begins with {r, eval=FALSE}. eval=FALSE makes these chunks not run when I knit the file.

Before you run this chunk, you should revert it to {r}.

library(readr)
library(leaps)
library(car)

## carData
library(carData)
UsedCars <- read_csv(“UsedCars.csv”)
##
## — Column specification ——————————————————–
## cols(
## Id = col_double(),
## Price = col_double(),
## Year = col_double(),
## Mileage = col_double(),
## City = col_character(),
## State = col_character(),
## Vin = col_character(),
## Make = col_character(),
## Model = col_character()

## )
# Delete the *** below and enter the model and state from homework #2
ModelOfMyChoice = “TX”
StateOfMyChoice = “300300C”
# Takes a subset of your model car from your state
MyCars = subset(UsedCars, Model==”300300C” & State==”TX”)
# Add a new variable for the age of the cars.
MyCars$Age = 2017 – MyCars$Year