AP Stats Casino Lab | April 2024 Update

AP Stats Casino Lab

Introduction

This lab will introduce you to the basics of applied statistics using data from a casino. We will be using the American Roulette Data Set from the Rdatasets package. This data set contains information on 10,000 roulette spins from a single casino.

Objectives

By the end of this lab, you will be able to:

  • Load data into R
  • Perform descriptive statistics on data
  • Create and interpret scatterplots
  • Conduct a hypothesis test

Getting Started

First, we need to load the data into R. We can do this using the read.csv() function.

data <- read.csv("roulette.csv")

This will create a data frame called data that contains the data from the roulette data set.

Descriptive Statistics

We can use the summary() function to get a quick overview of the data.

summary(data)

This will show us the mean, median, standard deviation, and range for each of the variables in the data set.

We can also use the plot() function to create a histogram of the data.

plot(data$Winnings)

This will create a histogram of the Winnings variable.

Scatterplots

We can use the plot() function to create a scatterplot of two variables.

plot(data$Winnings, data$Number)

This will create a scatterplot of the Winnings and Number variables.

Hypothesis Testing

We can use the t.test() function to conduct a hypothesis test.

t.test(data$Winnings, mu = 0)

This will conduct a t-test to test the hypothesis that the mean of the Winnings variable is equal to 0.

Conclusion

In this lab, we introduced you to the basics of applied statistics using data from a casino. We loaded data into R, performed descriptive statistics on the data, created and interpreted scatterplots, and conducted a hypothesis test.

Resources


[image_url_1] [image_url_2]

[image_url_3] [image_url_4]

[image_url_5] [image_url_6]

[image_url_7] [image_url_8]

SCR function already executed recently. It will run again after 4 minutes.


Learn the basics of applied statistics using data from a casino.


Nivesham

Nivesham

ap stats casino lab