49

What does the "vs" variable mean in the "mtcars" dataset in R? The helpfile says it means "V/S" but that is not enlightening.

Commands:

data(mtcars)
head(mtcars)
?mtcars
Jilber Urbina
  • 58,147
  • 10
  • 114
  • 138
ddunn801
  • 1,900
  • 1
  • 15
  • 20

2 Answers2

49

I think it's whether the car has a V engine or a straight engine. I'm basing this on the foot note on the page numered 396 of http://www.mortality.org/INdb/2008/02/12/8/document.pdf

GSee
  • 48,880
  • 13
  • 125
  • 145
  • 5
    Yes, I think that is correct, you can see the data dictionary in the [original 1976 paper by Hocking](http://www.jstor.org/stable/2529336?seq=12) on page 12. – nograpes Sep 04 '13 at 15:24
  • 7
    Also, oddly, `0` means a V-engine, and `1` straight engine. – nograpes Sep 04 '13 at 15:37
  • 14
    @rawr I think `am` is short for "automatic or manual" (and `vs` means "V" or "Straight"). With zero-based arrays, `0` is the first element, and `1` is the second. – GSee Apr 19 '14 at 22:30
  • very embarrassingly I didnt know this when teaching a R class, this post saved me! – Ajay Ohri Jul 03 '17 at 11:21
  • 1
    NB: in the original paper the variables are still referred to as X1 ... X10 as was common back in the days. The oddities thus do not seem to originate from the authors. – Richard Jul 30 '17 at 21:37
2

Binary variable signaling the engine cylinder configuration as either:

V-shape (vs=0) or Straight Line (vs=1)

Configuration offers trade offs in power/torque, design usage in terms of space/size of engine and performance or center of gravity of vehicle. The geometry and placement of the engine, as influenced by its cylinder head, can have numerous knock-on influences on the vehicle beyond the technical engineering considerations of the cyliner angle.

MBorg
  • 1,345
  • 2
  • 19
  • 38