建立您自己的網站
mtcars {datasets}R 文件

Motor Trend 汽車公路測試

描述

資料摘自 1974 年美國《Motor Trend》雜誌,包含了 32 輛汽車(1973-74 款)的燃油消耗以及 10 個方面的汽車設計和效能。

用法

mtcars

格式

一個包含 32 個觀測值和 11 個(數值型)變數的資料框。

[, 1] mpg每加侖(美國)英里數
[, 2] cyl氣缸數
[, 3] disp排量(立方英寸)
[, 4] hp總馬力
[, 5] drat後橋比
[, 6] wt重量(千磅)
[, 7] qsec1/4 英里加速時間
[, 8] vs發動機(0 = V 型,1 = 直列型)
[, 9] am變速箱(0 = 自動,1 = 手動)
[,10] gear前進擋數量
[,11] carb化油器數量

注意

Henderson 和 Velleman (1981) 在第 1 表的腳註中評論道:“Hocking(原始轉錄者)將馬自達的轉子發動機非關鍵地編碼為直列六缸發動機,將保時捷的水平對置發動機編碼為 V 型發動機,幷包含柴油版梅賽德斯 240D,這些都得以保留,以便與之前的分析進行直接比較。”

Source(來源)

Henderson and Velleman (1981), Building multiple regression models interactively. Biometrics, 37, 391-411.

示例

require(graphics)
pairs(mtcars, main = "mtcars data", gap = 1/4)
coplot(mpg ~ disp | as.factor(cyl), data = mtcars,
       panel = panel.smooth, rows = 1)
## possibly more meaningful, e.g., for summary() or bivariate plots:
mtcars2 <- within(mtcars, {
   vs <- factor(vs, labels = c("V", "S"))
   am <- factor(am, labels = c("automatic", "manual"))
   cyl  <- ordered(cyl)
   gear <- ordered(gear)
   carb <- ordered(carb)
})
summary(mtcars2)