knitr::opts_chunk$set(echo = TRUE)
library(SDS100)
$\$
$\$
$\$
library(SDS100) # Step 1: # Step 2: # Get the data, visualize it, and computer the statistic of interest # load the data.. # SDS100::download_data("CollegeScores4yr.csv") college <- read.csv("CollegeScores4yr.csv") college <- na.omit(college) # delete rows with missing data # how many colleges are in each type of location? cost <- college$Cost locale <- college$Locale table(college$Locale) # visualize the data - does there appear to be a difference? # calculate the MAD statistic # get_MAD_stat(data_vector, grouping_vector) # Step 3: Create the null distribution # visualize the null distribution # 4. Get the p-value # 5. Decision?
$\$
Do movies that have larger budgets have larger profits?
Let's look at correlation between budget and profit!
### Hypothesis test for correlation -------------- library(fivethirtyeight) # Hypothesis tests for correlations! # step 1 # step 2 bechdel3 <- na.omit(bechdel) budget <- bechdel3$budget_2013 gross <- bechdel3$domgross_2013 # plot the data and calculate the observed statistic # step 3: null distribution!!! # visualize the null distribution # step 4 # step 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.