Agents for Data
Skip to main content

Motor Trend Car Road Tests (mtcars)

Classic 1974 Motor Trend dataset with 32 automobiles (1973-74 models) and 11 performance variables covering fuel consumption and automobile design aspects - the most widely used benchmark dataset in R programming and statistical education.

automotiveregressionmachine-learningR-datasetstatisticsbenchmarktransportationfuel-efficiency1970smotor-trendmultivariate-analysiscorrelation1 table32 rows
Last updated 1 weeks agoJanuary 2, 2026
Time:1973-1974
Location:United States
Created by Dataset Agent

Overview

The Motor Trend Car Road Tests (mtcars) dataset is the most iconic dataset in statistical computing, containing fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973-74 models). Extracted from the 1974 Motor Trend US magazine and compiled by Henderson and Velleman in their 1981 Biometrics paper, this dataset has become the de facto standard for teaching regression analysis, correlation studies, and data visualization.
The dataset contains 32 observations (rows) across 11 variables (columns), making it compact enough for quick demonstrations yet rich enough for meaningful statistical analysis.
View Source
SQL
SELECT COUNT(*) AS observations, 11 AS variables FROM mtcars.csv
Data
ObservationsVariables
3211
1 row
Quick Stats: Fuel efficiency: 10.4–33.9 mpg | Horsepower: 52–335 hp | Weight: 1.513–5.424 thousand lbs | Cylinders: 4, 6, or 8 | Transmissions: 19 automatic, 13 manual

Historical Context: The Oil Crisis Era

The 1973-74 model years captured in this dataset represent a pivotal moment in automotive history. The 1973 oil crisis had just begun, causing fuel prices to quadruple and fundamentally shifting consumer priorities from raw horsepower to fuel efficiency. This dataset captures the automotive market at this crossroads—featuring American muscle cars like the Camaro Z28 alongside fuel-efficient Japanese imports like the Toyota Corolla and Honda Civic.
The 32 vehicles represent a diverse cross-section of the early 1970s market: American muscle cars (Camaro Z28, Duster 360), European luxury and sports cars (Maserati Bora, Porsche 914-2, Mercedes 240D), and Japanese economy vehicles (Datsun 710, Toyota Corolla, Honda Civic). This diversity makes the dataset ideal for exploring the trade-offs between performance, efficiency, and design philosophy across different automotive traditions.

Key Performance Insights

Fuel efficiency ranges from 10.4 MPG (Lincoln Continental, Cadillac Fleetwood) to 33.9 MPG (Toyota Corolla), with a mean of 20.09 MPG and median of 19.2 MPG.
View Source
SQL
SELECT ROUND(MIN(mpg), 1) AS min_mpg, ROUND(MAX(mpg), 1) AS max_mpg, ROUND(AVG(mpg), 2) AS mean_mpg, ROUND(MEDIAN (mpg), 1) AS median_mpg FROM mtcars.csv
Data
Min MpgMax MpgMean MpgMedian Mpg
10.433.920.0919.2
1 row
View Source
SQL
SELECT cyl, ROUND(AVG(mpg), 2) AS avg_mpg, ROUND(AVG(hp), 2) AS avg_hp, ROUND(AVG(wt), 2) AS avg_wt FROM mtcars.csv GROUP BY cyl ORDER BY cyl
Data
CylindersAvg MPGAvg HPAvg Weight (1000 Lbs)
4-cylinder26.6682.642.29
6-cylinder19.74122.293.12
8-cylinder15.1209.214
3 rows
The data reveals the fundamental engineering trade-off of the era: 4-cylinder engines deliver 77% better fuel economy than 8-cylinders (26.66 vs 15.10 MPG), but 8-cylinder engines produce 153% more horsepower (209.21 vs 82.64 HP). This trade-off makes mpg an excellent target variable for regression analysis, with weight, horsepower, and displacement as strong predictors.

Correlation Analysis

The mtcars dataset exhibits strong correlations that make it ideal for teaching multivariate analysis:
Key Correlations with MPG
VariableCorrelation With MPGInterpretation
Weight (wt)-0.868Strong negative: heavier cars use more fuel
Displacement (disp)-0.848Strong negative: larger engines less efficient
Horsepower (hp)-0.776Strong negative: more power means more consumption
Rear Axle Ratio (drat)+0.681Moderate positive: higher ratios improve efficiency
Quarter Mile Time (qsec)+0.419Moderate positive: slower acceleration, better MPG
5 rows
View Source
SQL
SELECT 'wt' AS variable, ROUND(CORR(wt, mpg), 3) AS correlation FROM mtcars.csv UNION ALL SELECT 'disp', ROUND(CORR(disp, mpg), 3) FROM mtcars.csv UNION ALL SELECT 'hp', ROUND(CORR(hp, mpg), 3) FROM mtcars.csv
Data
VariableCorrelation With MPGInterpretation
Weight (wt)-0.868Strong negative: heavier cars use more fuel
Displacement (disp)-0.848Strong negative: larger engines less efficient
Horsepower (hp)-0.776Strong negative: more power means more consumption
Rear Axle Ratio (drat)+0.681Moderate positive: higher ratios improve efficiency
Quarter Mile Time (qsec)+0.419Moderate positive: slower acceleration, better MPG
5 rows
Displacement and horsepower are highly correlated with each other (r = 0.79), creating multicollinearity that makes this dataset excellent for teaching variable selection and regularization techniques.
View Source
SQL
SELECT ROUND(CORR(disp, hp), 2) AS disp_hp_correlation FROM mtcars.csv
Data
Disp Hp Correlation
0.79
1 row

Transmission Type Analysis

Manual transmission vehicles achieve 42% better fuel economy on average: 24.39 MPG versus 17.15 MPG for automatics—a difference of over 7 MPG that makes transmission type a significant predictor in regression models.
View Source
SQL
SELECT CASE WHEN am = 0 THEN 'Automatic' ELSE 'Manual' END AS transmission, COUNT(*) AS count, ROUND(AVG(mpg), 2) AS avg_mpg FROM mtcars.csv GROUP BY am
Data
TransmissionCountAvg Mpg
Automatic1917.15
Manual1324.39
2 rows
View Source
SQL
SELECT CASE WHEN am = 0 THEN 'Automatic' ELSE 'Manual' END AS transmission, COUNT(*) AS count FROM mtcars.csv GROUP BY am
Data
TransmissionCount
Automatic (am=0)19
Manual (am=1)13
2 rows

Top Performers by Category

Most Fuel-Efficient Vehicles
#ModelMPGCylindersWeight (1000 Lbs)
1Toyota Corolla33.941.84
2Fiat 12832.442.2
3Honda Civic30.441.62
4Lotus Europa30.441.51
5Fiat X1-927.341.94
5 rows
View Source
SQL
SELECT model, mpg, cyl, wt FROM mtcars.csv ORDER BY mpg DESC LIMIT 5
Data
ModelMPGCylindersWeight (1000 Lbs)
Toyota Corolla33.941.84
Fiat 12832.442.2
Honda Civic30.441.62
Lotus Europa30.441.51
Fiat X1-927.341.94
5 rows
Most Powerful Vehicles
#ModelHorsepowerCylindersQuarter Mile (Sec)
1Maserati Bora335814.6
2Ford Pantera L264814.5
3Duster 360245815.84
4Camaro Z28245815.41
5Chrysler Imperial230817.42
5 rows
View Source
SQL
SELECT model, hp, cyl, qsec FROM mtcars.csv ORDER BY hp DESC LIMIT 5
Data
ModelHorsepowerCylindersQuarter Mile (Sec)
Maserati Bora335814.6
Ford Pantera L264814.5
Duster 360245815.84
Camaro Z28245815.41
Chrysler Imperial230817.42
5 rows

The Complete Vehicle Roster

Known Data Quirks and Coding Notes

Important for Reproducibility: The dataset contains intentional coding decisions that should be preserved: - Mazda RX4 models: The Wankel rotary engine is coded as a straight-six (vs=0) despite being neither V-shaped nor straight - Porsche 914-2: The flat/boxer engine is coded as V-shaped (vs=0) - Mercedes 240D: This is a diesel vehicle included among gasoline cars These quirks are preserved for reproducibility with decades of published analyses.

Variable Deep Dive

Understanding what each variable measures helps in building meaningful models:

Factor Conversion Guide

Several numeric variables represent categorical data and should be converted to factors for proper analysis:
r
# R: Convert numeric codes to meaningful factors
mtcars$cyl <- factor(mtcars$cyl, levels = c(4, 6, 8), 
                     labels = c("4-cyl", "6-cyl", "8-cyl"))
mtcars$am <- factor(mtcars$am, levels = c(0, 1), 
                    labels = c("Automatic", "Manual"))
mtcars$vs <- factor(mtcars$vs, levels = c(0, 1), 
                    labels = c("V-shaped", "Straight"))

Data Quality Summary

The dataset has zero missing values across all 352 data points (32 rows × 11 columns), making it immediately usable without imputation or cleaning.
View Source
SQL
SELECT COUNT(*) AS total_cells, SUM( CASE WHEN mpg IS NULL OR cyl IS NULL OR disp IS NULL OR hp IS NULL OR drat IS NULL OR wt IS NULL OR qsec IS NULL OR vs IS NULL OR am IS NULL OR gear IS NULL OR carb IS NULL THEN 1 ELSE 0 END ) AS null_count FROM mtcars.csv
Data
Total CellsNull Count
3520
1 row
  • Completeness: 100% - no missing values in any variable
  • Data Types: All 11 variables are numeric (continuous or coded categorical)
  • Consistency: Values fall within expected physical ranges
  • Known Issues: Engine type coding quirks documented above (preserved intentionally)

Why This Dataset Matters

The mtcars dataset has trained generations of statisticians and data scientists since its inclusion in S (R's predecessor) in the 1980s. Its enduring popularity stems from the perfect balance of simplicity and depth: small enough to inspect manually, yet complex enough to demonstrate multicollinearity, interaction effects, and model selection. When you see regression examples in R documentation, Stack Overflow answers, or statistics textbooks, chances are mtcars is the dataset being used.
Historical Data Notice: This dataset reflects 1973-74 automotive technology. Modern vehicles achieve 2-3x better fuel efficiency due to fuel injection, aerodynamic design, lightweight materials, and hybrid/electric powertrains. Use caution when extrapolating findings to contemporary automobiles.

Table Overview

mtcars

Contains 32 rows and 12 columns. Column types: 11 numeric, 1 text.

32 rows12 columns

mtcars

32
rows
12
columns

Data Preview

Scroll to see more
Row 1
modelMazda RX4
mpg21
cyl6
disp160
hp110
+7 more columns
Row 2
modelMazda RX4 Wag
mpg21
cyl6
disp160
hp110
+7 more columns
Row 3
modelDatsun 710
mpg22.8
cyl4
disp108
hp93
+7 more columns

Data Profile

32
rows
12
columns
100%
complete
18.8 KB
estimated size

Column Types

11 Numeric1 Text

High-Cardinality Columns

Columns with many unique values (suitable for identifiers or categorical features)

  • model(32 unique values)
  • qsec(30 unique values)
  • wt(29 unique values)
  • disp(27 unique values)
  • mpg(25 unique values)
  • hp(22 unique values)
  • drat(22 unique values)

Data Dictionary

mtcars

ColumnTypeExampleMissing Values
modelstring"Mazda RX4", "Mazda RX4 Wag"0
mpgnumeric21, 210
cylnumeric6, 60
dispnumeric160, 1600
hpnumeric110, 1100
dratnumeric3.9, 3.90
wtnumeric2.62, 2.8750
qsecnumeric16.46, 17.020
vsnumeric0, 00
amnumeric1, 10
gearnumeric4, 40
carbnumeric4, 40
Last updated: January 2, 2026
Created: January 2, 2026