HW1_Starter Template_R (Summer 24, 5

.Rmd

School

Georgia Institute Of Technology *

*We aren’t endorsed by this school

Course

6414

Subject

Statistics

Date

Jun 2, 2024

Type

Rmd

Pages

5

Uploaded by GrandRat2927

--- title: "HW1 Peer Assessment" output: html_document: df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Part A. Variables In the field of psychology, much research is done using self- report surveys using Likert scales (look it up!). ### A1 __What type of variable is a Likert response?__ (1 pt) ### A2 __What are some (at least 2) benefits of using Likert scales?__ (2 pts) ### A3 __What are some drawbacks of using them? Make sure you mention at least one 'drawback' and one 'danger' (a 'drawback' is a shortcoming, while a 'danger' implies potential harm).__ (2 pts) # Part B. Simple Linear Regression Perform linear regressions on a dataset from a European Toyota car dealer on the sales records of used cars (Toyota Corolla). We would like to construct a reasonable linear regression model for the relationship between the sales prices of used cars and various explanatory variables (such as age, mileage, horsepower). We are interested to see what factors affect the sales price of a used car and by how much. Data Description *Id* - ID number of each used car *Model* - Model name of each used car *Price* - The price (in Euros) at which each used car was sold *Age* - Age (in months) of each used car as of August 2004 *KM* - Accumulated kilometers on odometer
*HP* - Horsepower *Metallic* - Metallic color? (Yes = 1, No = 0) *Automatic* - Automatic transmission? ( Yes = 1, No = 0) *CC* - Cylinder volume (in cubic centimeters) *Doors* - Number of doors *Gears* - Number of gears *Weight* - Weight (in kilograms) The data is in the file "UsedCars.csv". To read the data in `R`, save the file in your working directory (make sure you have changed the directory if different from the R working directory) and read the data using the `R` function `read.csv()`. Read data and show few rows of data. ```{r} # Read in the data data = read.csv("UsedCars.csv",sep = ",",header = TRUE) # Show the first few rows of data head(data, 3) ``` ## Question B1: Exploratory Data Analysis a. **3 pts** Use a scatter plot to describe the relationship between Price and the Accumulated kilometers on odometer. Describe the general trend (direction and form). Include plots and R-code used. ```{r} # Your code here... ``` b. **3 pts** What is the value of the correlation coefficient between *Price* and *KM*? Please interpret the strength of the correlation based on the correlation coefficient. ```{r} # Your code here... ```
c. **2 pts** Based on this exploratory analysis, would you recommend a simple linear regression model for the relationship? d. **1 pts** Based on the analysis above, would you pursue a transformation of the data? *Do not transform the data.* ## Question B2: Fitting the Simple Linear Regression Model Fit a linear regression model, named *model_1*, to evaluate the relationship between UsedCars Price and the accumulated KM. *Do not transform the data.* The function you should use in R is: ```{r} # Your code here... ``` a. **3 pts** What are the model parameters and what are their estimates? b. **2 pts** Write down the estimated simple linear regression equation. c. **2 pts** Interpret the estimated value of the $\beta_1$ parameter in the context of the problem. d. **2 pts** Find a 95% confidence interval for the $\beta_1$ parameter. Is $\beta_1$ statistically significant at this level? ```{r} # Your code here... ``` e. **2 pts** Is $\beta_1$ statistically significantly negative at an $\alpha$-level of 0.01? What is the approximate p-value of this test? ```{r} # Your code here... ```
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help