2024-06-05

R Markdown

This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.

Linear regression

  • Linear regression is the process of gathering data between two variables or observable and using that data to predict the dependent variable.

Slide with R Output

## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
car = read.csv("car_prediction_data.csv")

Scatterplot with plotly

  • It is shown from this plot that the average selling price of cars is increasing with time.
  • Variances in selling price per year are accounted for the different types of cars being sold

Scatterplot ggplot

-The difference between selling price and present price remained roughly constant over time -This difference was calculated with the equation: y2 = abs(selling price - present price) ## Year vs Present price -The present price increased steadily with time. ## Conclusion - There is a positive correlation between the selling price of a car and the year -The more recent the year, the higher a car will be on sale