menuStatistics, Data, and AI in Business

Chapter 1: Statistics, Data, and AI in Business

Learning Objectives

  1. Explain why businesses use statistics to make decisions when the outcome is uncertain.
  2. Identify observations and variables in a data set, and classify each variable as categorical (nominal or ordinal) or numeric (discrete or continuous).
  3. Distinguish a population from a sample, a parameter from a statistic, and descriptive from inferential statistics.
  4. Describe the workflow this book uses: preparing data in Excel, working with an AI assistant, running R scripts in JOLT, and checking the results in Excel.
  5. Write a simple data description and use it to start a conversation with an AI assistant about an analysis.

1.1 Why Businesses Need Statistics

Every business makes decisions without knowing for sure how they will turn out. Should we run a promotion next month? Is the new training program worth what it costs? Are customers at one location happier than at another, or did we just happen to talk to a few cheerful people? Should we add a drive-thru?

Nobody can answer these questions with certainty. A business can collect data, though: records of what actually happened. Statistics is a set of methods for learning from data when the answer isn't obvious and the data contain some randomness. It helps you answer two kinds of questions:

The second kind of question is where statistics earns its place in business. Intuition answers "what happened" reasonably well. Intuition is bad at telling a real pattern from random noise. People see patterns in noise all the time, and they miss real patterns hidden in it. Statistical methods give you a disciplined way to decide how much a set of numbers can support a conclusion.

Statistics — The science of collecting, organizing, summarizing and analyzing data, and of drawing conclusions from data when there is uncertainty.

You don't need to be a statistician to use statistics well in business. You do need to know what each method asks, what it assumes, and what its answer means. That's what this book teaches.

1.2 Data and Variables

Data come in many forms, but most of the data you'll analyze in this course is arranged the same way: as a table, with one row for each thing you recorded and one column for each fact about it. That's exactly the shape of an Excel worksheet, which is one reason Excel is such a common tool for business data.

Here are the first six rows of a customer survey that you'll work with all semester. Each row is one customer's response.

response_id visit_date store_id age loyalty_member visits_per_week order_type wait_minutes satisfaction spend would_recommend
R0001 2025-04-01 S09 51 Yes 5 Counter 4.6 8 13.12 Yes
R0002 2025-12-28 S09 22 Yes 2 Mobile 3.2 9 8.27 Yes
R0003 2025-04-23 S02 57 No 6 Mobile 1.2 9 5.26 Yes
R0004 2025-12-06 S01 19 No 1 Counter 4.3 6 6.31 No
R0005 2025-10-15 S06 50 Yes 5 Drive-thru 5.6 7 10.51 Yes
R0006 2025-01-02 S09 27 Yes 4 Mobile 4.2 9 4.34 Yes

Observation — One unit you recorded information about, such as one customer, one store, one day or one transaction. In a well-organized table, each observation is one row.

Variable — A characteristic that is recorded for each observation and can differ from one observation to the next. In a well-organized table, each variable is one column.

The survey has 600 observations (customers) and 11 variables. The first thing to ask about any data set is what one row represents. Here a row is one survey response. In the daily sales data you'll meet later, a row is one store on one day. Mixing those up leads to some of the most common mistakes in business analysis, such as averaging averages or counting the same customer twice.

1.2.1 Types of variables

Not all variables can be analyzed the same way. You can average customers' ages, but you can't average their order types. The type of a variable decides which summaries, charts and tests make sense, so identifying the type of each variable is the first step in every analysis in this book.

A categorical variable places each observation in a group. Its values are labels, even if those labels happen to be numbers.

A numeric variable (also called a quantitative variable) records an amount, where arithmetic makes sense.

Categorical variable — A variable whose values are group labels. It is nominal if the groups have no natural order and ordinal if they do.

Numeric variable — A variable whose values are amounts that can be added, subtracted and averaged. It is discrete if it counts something and continuous if it measures something.

Two columns in the survey don't fit neatly into either type. response_id is an identifier: it labels each row so you can find it, but you'd never analyze it. visit_date is a date, which you can treat as categorical (which month?) or numeric (how many days ago?) depending on the question.

Numbers aren't always numeric. store_id could have been coded 1, 2, 3, … instead of S01, S02, S03. Excel would then happily compute an "average store" of 6.4, which means nothing. Before you summarize a column, ask whether arithmetic on it makes sense.

The satisfaction rating is a classic gray area. Strictly, it's ordinal: the gap between a 3 and a 4 may not feel the same to a customer as the gap between a 9 and a 10. In practice, businesses routinely average ratings like this, and with a 10-point scale that's usually reasonable. This book will point out when a choice like that matters and when it doesn't.

1.2.2 Cross-sectional and time series data

The survey records many customers at roughly the same time, without following any one customer over time. That's cross-sectional data. Ridgeline's daily sales records, which track each store day after day through 2025, are time series data. Many of the methods in this book assume observations are independent of each other. Time series data often break that assumption, because one day's sales tend to resemble the next day's. You'll see where that matters as the book goes on.

1.3 Populations, Samples and Inference

Ridgeline served hundreds of thousands of customers in 2025. It surveyed 600 of them. The owners don't really care about those 600 people in particular. They care about customers in general, and they use the 600 to learn about the rest.

Population — The entire group you want to draw conclusions about, such as all of Ridgeline's customers in 2025.

Sample — The part of the population you actually collected data from, such as the 600 customers who answered the survey.

A number that describes a population is a parameter. A number calculated from a sample is a statistic. In the survey, 407 of the 600 customers (67.8%) said they would recommend Ridgeline to a friend. That 67.8% is a statistic. The share of all Ridgeline customers who would recommend it is a parameter. Nobody knows it exactly, because nobody asked everyone.

Parameter — A number that describes a population. It's usually unknown.

Statistic — A number calculated from a sample. It's used to estimate a parameter.

That gives the two branches of statistics:

Descriptive statistics — Methods that summarize and display the data you have.

Inferential statistics — Methods that use sample data to draw conclusions about a population, along with a measure of how confident you can be.

Here's why the difference matters. In the survey, customers of Ridgeline's Metro stores gave an average satisfaction rating of 7.0. Customers of its Mountain stores averaged 8.4. That's a descriptive fact about these 600 people. Before Ridgeline's owners act on it, for example by sending Metro managers to learn from Mountain managers, they need to know whether the gap reflects real differences among all customers, or whether a different 600 customers might have shown no gap at all. Answering that question is inference, and most of this book is about how to do it.

A sample only tells you about a population if it represents that population. If Ridgeline had surveyed only customers who used the mobile app, or only those who chose to fill out a comment card, the sample might differ from customers in general in ways no statistical method can fix. A random sample, where every member of the population has a known chance of being chosen, is the standard way to avoid that problem. The methods in this book assume the sample was collected in a reasonable way, and part of your job as an analyst is to question that assumption.

Random sample — A sample chosen so that every member of the population has a known, nonzero chance of being selected, and the choice isn't left to anyone's judgment.

1.4 Meet Ridgeline Coffee Co.

All the data in this book comes from one business: Ridgeline Coffee Co., a fictional regional coffee chain. Using one business all semester lets you get to know its data well, the way you would in a real job, and see how many different questions a single company's data can answer.

Ridgeline has 12 stores in three regions:

You've just been hired as a part-time analyst in Ridgeline's head office while you finish your degree. The co-owners, Dana Whitfield and Marcus Bell, have plenty of questions and a growing pile of data. Over the semester you'll work with these data sets:

Data set One row is… Rows What it records
Stores a store 12 region, year opened, seats, whether it has a drive-thru
Daily sales one store on one day in 2025 4,380 transactions, average ticket, revenue, whether it was a promo day, the day's high temperature
Customer survey a customer's survey response 600 age, loyalty membership, visits per week, order type, wait time, satisfaction, spend, would recommend
Staff an employee 104 role, tenure, whether they completed barista training, hours, wage, customer rating
Coupon test a loyalty customer in a randomized test 1,000 whether they got a mobile coupon, whether they used it, visits and spending over the next 30 days

These are some of the questions the owners want answered. You'll answer each of them before the semester ends:

Ridgeline is fictional. Its data was generated for this book so that every question has a real answer to find and every number in the book can be checked. The patterns in it were chosen to resemble what real coffee chains see, but they aren't real company data.

1.5 How You'll Work in This Book

Statistics courses used to spend most of their time on calculation: plugging numbers into formulas by hand or with a calculator. Software has done the calculations for decades, and now an AI assistant can write the analysis for you, too. What's left for you is the part that requires judgment: knowing what question you're asking, choosing a method that fits the question and the data, checking that the method's assumptions hold, and explaining what the result means for the business.

This book is built around that division of labor. Every analysis follows the same loop, with four tools:

  1. Excel is where your data lives. You'll open, clean, organize and explore data there, and that preparation is often most of the work in a real analysis. You'll get plenty of Excel practice: Tables, formulas, PivotTables, charts and Excel's built-in statistical functions.
  2. An AI assistant (such as ChatGPT, Claude, Gemini or Copilot) is your analysis partner and tutor. You describe your data and your business question in plain English, talk through which analysis fits, and ask it to write an R script that performs the analysis.
  3. R is a programming language built for statistics. It's free, it's used by statisticians and data scientists around the world, and it can run every test in this book (and thousands more). You won't learn to write R. You will learn to read an R script well enough to see what it does.
  4. JOLT is an add-in for Excel. Its R for Excel app runs R inside Excel itself, so there's nothing else to install. It hands your workbook's data to R, helps you write the prompt for your AI, runs the script the AI sends back, and puts the results into a worksheet, where you can read them, check them and build on them.

A diagram of the workflow loop: Excel (prepare the data) → AI assistant (describe the data and question) → R script → JOLT (runs the script) → Excel (results in a new sheet; read, check, present) → back to Excel. Label the reader's job at each step: "prepare," "describe," "read the script," "run," "interpret and verify."

Why not do everything in Excel? Excel can compute many of the statistics in this book, and you'll use its functions to check your results. But some tests are awkward in Excel, some aren't built in at all, and building an analysis out of dozens of formulas is slow and error-prone. R does each test in a line or two, and does it the way professional analysts do. Why not do everything in R? Because Excel is where business data actually lives, where your future coworkers will look at it, and where you can see your data. Working in both gives you the best of each.

Why an AI assistant? Writing R is a skill that takes months to learn, and it isn't the point of this course. An AI can write a correct script in seconds, if you describe your data and your question clearly. Learning to give that description is one of the most useful skills this course teaches, because it's the same skill you need to work with a human analyst, a consultant or a data team.

Excel with the R for Excel task pane open (panels "1. Data," "2. Ask your AI" and "3. Run R code"), showing an R script ready to run and, behind it, a new worksheet with the results of an analysis of the Ridgeline survey.

You'll set up JOLT and do your first complete trip around the loop in Chapter 2. Working with AI and R for Excel. In this chapter, you'll start with the second step: talking to an AI about data.

1.6 Talking to an AI About Data

An AI assistant knows a great deal about statistics. It knows nothing about your data, though. It can't see your spreadsheet unless you show it, and it doesn't know what your columns mean, what one row represents, or what your boss is really asking. If you leave those things out, the AI fills the gaps with guesses, and its answer sounds just as confident either way.

So every analysis in this book starts with a data description: a short, plain-text summary of your data that you paste into the conversation before you ask for anything. A good data description says:

Data description — A short, plain-text summary of a data set (what one row represents, how many rows there are, and each column's name, type and values), written so that someone who can't see the data can still reason about it correctly.

Here's a data description for the Ridgeline survey. Notice that it says what each column means, not just its name. "satisfaction" alone doesn't tell the AI whether the scale runs from 1 to 5 or from 1 to 10, or whether high is good.

Data: Ridgeline Coffee customer survey, 600 rows, one row per survey response.
Columns:
- response_id: identifier (R0001 to R0600)
- visit_date: date of the visit, in 2025
- store_id: which of 12 stores (S01 to S12)
- age: customer's age in years
- loyalty_member: Yes or No
- visits_per_week: how many times a week the customer usually visits (0 to 14)
- order_type: Counter, Mobile, or Drive-thru
- wait_minutes: minutes from joining the line to getting the order
- satisfaction: rating of the visit from 1 (very dissatisfied) to 10 (very satisfied)
- spend: dollars spent on the visit
- would_recommend: Yes or No

Start a new conversation, paste the data description, and in the same message ask the AI to do something you can check against what you just learned: classify the variables.

Needs: a reply that classifies all 11 columns, ideally flags satisfaction as ordinal-but-often-treated-as-numeric, and (if possible) makes at least one call worth discussing, such as treating age as discrete or visit_date as numeric. The text after this block compares the reply to the chapter's classification.

Compare the AI's answer to the classification earlier in this chapter. Where it differs, decide who is right and why. Sometimes the AI will be wrong. Sometimes it will make a reasonable choice that differs from the book's, such as calling age discrete because it's recorded in whole years. Being able to tell those two situations apart is the skill this course is building.

Now try a real business question. Don't ask the AI to run anything yet. Ask it to talk through the options with you.

Needs: a reply that suggests a scatterplot plus correlation and/or simple regression of satisfaction on wait_minutes, possibly a comparison of average satisfaction for short vs. long waits, and ideally a caveat that this shows association, not causation. The text after this block picks out those ideas and connects them to later chapters.

You'll probably see the AI suggest a scatterplot, a correlation and a regression. You'll learn what each of these does, and how to tell whether the relationship it finds is real, in Chapter 12. Correlation and Simple Regression. For now, notice what the conversation did. With a clear description of the data and a clear question, the AI could suggest sensible methods without ever seeing a single row. That conversation, followed by a request for an R script, is how every analysis in this book begins.

Start a new conversation for each analysis, and begin it with the data description. AI assistants can lose track of details from early in a long conversation, and a fresh start with a complete description avoids that.

1.7 What AI Gets Wrong, and Why You Stay in Charge

AI assistants are very good at statistics in general and can be quietly wrong about your analysis in particular. The mistakes this book will train you to catch are:

Never report a number an AI typed into a chat. Report only numbers that came from an analysis that actually ran on your data (in JOLT or in Excel) and that you've checked.

That's why the workflow loop ends in Excel, with you. After JOLT puts the results in your workbook, you'll verify them. Wherever Excel has a matching function, you'll compute the key number a second way and confirm that the two agree. For example, you can check an average with AVERAGE, a correlation with CORREL, or a t-test with T.TEST. Then you'll ask whether the result makes sense: is the direction plausible, and is the size reasonable? Finally, you'll translate it into a sentence a busy owner can act on.

The AI writes code faster than you ever will. You're the one who knows what the business needs to decide, and you're responsible for the conclusion.

1.8 A Map of the Tests Ahead

Statistical tests can feel like a long list of unrelated recipes. They're more organized than that. Most of what you'll do this semester comes down to the type of question you're asking and the types of variables involved. You'll learn these in this order:

The question The variables involved The method Ridgeline example Chapter
What does the data look like? any descriptive statistics and charts What's a typical day's revenue at each store? Chapter 4. Describing Data
How likely is an outcome? one numeric or Yes/No variable probability distributions How often does a store top 500 transactions? Chapter 5. Probability and Distributions
What's the population value, roughly? one numeric, or one Yes/No confidence interval What share of all customers would recommend us? Chapter 7. Confidence Intervals
Is a population value different from a target? one numeric one-sample t-test Is the average wait longer than 4 minutes? Chapter 8. Hypothesis Testing
Do two groups differ? numeric outcome, two groups two-sample or paired t-test Do promo days have more transactions? Chapter 9. Comparing Two Groups
Do two groups differ in a percentage? Yes/No outcome, two groups two-proportion test Did coupon customers return more often? Chapter 9. Comparing Two Groups
Do several groups differ? numeric outcome, three or more groups analysis of variance (ANOVA) Does satisfaction differ by region? Chapter 10. Comparing Many Groups: ANOVA
Are two categorical variables related? two categorical chi-square test Is order type related to recommending? Chapter 11. Relationships in Categorical Data
Are two numeric variables related? two numeric correlation and simple regression Does waiting longer lower satisfaction? Chapter 12. Correlation and Simple Regression
What predicts an outcome? numeric outcome, several predictors multiple regression What drives daily transactions? Chapter 13. Multiple Regression

Every one of these methods rests on the same few ideas, which you'll meet in the first half of the course: variability, sampling, the normal distribution, and the logic of a hypothesis test. Understanding those ideas well is what will make the tests in the second half make sense, rather than feel like recipes.

1.9 Summary

Statistics gives businesses a disciplined way to learn from data and to separate real patterns from random noise. A data set is made of observations (rows) and variables (columns), and a variable's type (nominal, ordinal, discrete or continuous) determines how it can be analyzed. Descriptive statistics summarize the data you have. Inferential statistics use a sample to draw conclusions about a population, with a measure of how uncertain those conclusions are.

In this book you'll analyze the data of Ridgeline Coffee Co. using a loop of four tools: Excel to prepare and check data, an AI assistant to plan the analysis and write R scripts, R to run the analysis, and JOLT to carry the script and its results between R and Excel. The AI does the coding. Your job is to describe the data clearly, choose an analysis that fits the question, check the results, and explain what they mean. That job starts with a good data description, the habit you'll build in every chapter.