Module 7 Assignment
For this assignment, I chose to analyze the distribution of the mtcars dataset, which is readily available in R. The mtcars dataset contains information about various characteristics of different car models, such as miles per gallon (mpg), number of cylinders (cyl), and horsepower (hp), among others. To start, I imported the mtcars dataset into RStudio using the following code: R ``` data(mtcars) ``` Next, I performed a distribution analysis on three variables from the mtcars dataset: mpg, cyl, and hp. I used histograms to visualize the distribution of each variable individually and then created a grid of histograms to compare their distributions side by side. Here's the R code to create the grid of histograms: R ``` # Load necessary libraries library(gridExtra) # Create histograms for each variable mpg_hist <- hist(mtcars$mpg, main = "Distribution of MPG", xlab = "MPG", col = "lightblue") cyl_hist <- hist(mtcars$cyl, main = "Distribution