# Exploring Binary and Categorical Data

## **Mode**&#x20;

The mode is the value — or values in case of a tie — that appears most often in the data. For example, the mode of the cause of delay at Dallas/Fort Worth airport is “Inbound.” As another example, in most parts of the United States, the mode for religious preference would be Christian. The mode is a simple summary statistic for categorical data, and it is generally not used for numeric data.

## **Expected Value**

&#x20;A special type of categorical data is data in which the categories represent or can be mapped to discrete values on the same scale. A marketer for a new cloud technology, for example, offers two levels of service, one priced at $300/month and another at $50/month. The marketer offers free webinars to generate leads, and the firm figures that 5% of the attendees will sign up for the $300 service, 15% for the $50 service, and 80% will not sign up for anything. This data can be summed up, for financial purposes, in a single “expected value,” which is a form of weighted mean in which the weights are probabilities. The expected value is calculated as follows: 1. Multiply each outcome by its probability of occurring. 2. Sum these values. In the cloud service example, the expected value of a webinar attendee is thus $22.50 per month, calculated as follows:

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-LboV6ffbRdM2AHpS-aN%2F-LboWwBRvINgNKdAFQ0Q%2Fimage.png?alt=media\&token=c7f23526-c2cf-4a0e-bcde-1958d83c8b05)

The expected value is really a form of weighted mean: it adds the ideas of future expectations and probability weights, often based on subjective judgment. Expected value is a fundamental concept in business valuation and capital budgeting — for example, the expected value of five years of profits from a new acquisition, or the expected cost savings from new patient management software at a clinic.

## **Bar charts**&#x20;

The frequency or proportion for each category plotted as bars.&#x20;

## **Pie charts**&#x20;

The frequency or proportion for each category plotted as wedges in a pie.

{% hint style="info" %}
**KEY IDEAS**

Categorical data is typically summed up in proportions, and can be visualized in a bar chart.&#x20;

Categories might represent distinct things (apples and oranges, male and female), levels of a factor variable (low, medium, and high), or numeric data that has been binned.&#x20;

Expected value is the sum of values times their probability of occurrence, often used to sum up factor variable levels.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://julienbeaulieu.gitbook.io/wiki/books/untitled/statistics/exploring-binary-and-categorical-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
