JG.

Distribution Analysis Using MTCARS

We use R's mtcars dataset to explore distribution analysis. MTCARS is a dataset built into R Lang that provides a dataset that contains a list of cars, their miles per gallon(mpg), number of cylinders, displacement, horsepower(hp), weight, quater mile times, engine type (v or inline), tranmision type, gears, and number of carburetors. This is a great dataset to explort if you are learning R language and wanted to explore making calculations or visuals.

I created a grid of 4 charts to show different types of anaylsis that are examples of distribution analysis.

Screenshot 2024-02-26 at 12.56.54 AM.png

The top left chart shows a box plot of MPG grouped by the number of cylinders. This plot shows the distribution of MPG for the different numbers of cylinders. It helps visualize the central tendency (median) and spread of MPG within each cylinder group. It also identifies any potential outliers in the MPG distribution for each cylinder group. You are able to quickly visualize the more cylinders a vehicle has, the lower the fuel efficency is.

Screenshot 2024-02-26 at 1.29.55 AM.png

The top right chart is a scatter plot of displacement vs MPG. This plot examines the relationship between engine displacement (in cubic inches) and MPG. It helps identify any patterns or trends in how engine size relates to fuel efficiency. Again we are able to determine that the bigger the engine, or in this case displacement of the engine not physical size, the fuel effiencey again goes down. This indicates that there is a relationship between displacement and MPG.

Screenshot 2024-02-26 at 1.30.06 AM.png

The bottom left shows another scatter plot of number of cylinders vs horsepower. Again we are quickly able to determine that their is a clear relation between number of cylinders and the amount of horsepower a car may have.

Screenshot 2024-02-26 at 1.30.19 AM.png

Finally we have a bar garph that displays the average horsepower by number of Cylinders. The plot is the average between all the cars in the dataset that have 4, 6 and 8 cylinders. This is a bit of a better visual than the previously used scatter plot.

Screenshot 2024-02-26 at 1.31.10 AM.png



Exploring the different patterns that can be found using this dataset was interesting. I have saved my code to github to be viewed here.