Learn With Numbers

Glossary

Binary variable

What is a binary variable?

A variable with exactly two possible values.

A binary variable is the simplest kind of categorical variable: every observation falls into one of just two groups, such as yes or no.

Binary variables can also be stored as 1 and 0, and sometimes it is meaningful to treat them like numerical variables. For example, if "Has a pet" is stored as 1 and 0, its average is the share of respondents who own a pet: an average of 0.4 means 40% are pet owners.

From our own dataset

"Has a pet": yes or no.

Where we teach it

Lesson 1.2 of Project 1: Sibling Interviews. Watch lesson 1.2 and read the notes, free with a free account.

Related terms