knitr::opts_chunk$set(echo = TRUE)

$\$

Bechdel analyses: histograms, means, and medians

$\$

library(fivethirtyeight)

data(bechdel)

domgross <- bechdel$domgross_2013



# plot a histogram of the data with the axes labeled




# calculate the mean and median





# add lines to the histogram and the mean and median

$\$

Bechdel analyses: Z-scores and quantiles

We can calculate z-scores using the formula: $z_i = \frac{x_i - \bar{x}}{s}$

$\$

# the revenue for star wars
star_wars_gross <- 1771682790


# calculate the z-score for star wars

$\$

Bechdel analyses: quantiles

$\$

# movie quantiles  




# five number summary

$\$

DOW analyses: comparison to normal distribution

# load the dow data 

# SDS100::download_data("DowPrices.csv") 
dow <- read.csv("DowPrices.csv")

# get the daily percent change
percent_change <- dow$PercentChange


# calculate the range where 95% of the data is expected if the data were normally distributed






# get the actual quantiles from the data





# create a histogram of the data







# get a five number summary


emeyers/SDS100 documentation built on April 28, 2024, 5:07 p.m.