knitr::opts_chunk$set(echo = TRUE)
library(SDS100)
Multiple-choice questions on Advanced Placement exams have five options: A, B, C, D, and E. A random sample of the correct choice on 400 multiple-choice questions on a variety of AP shows that B was the correct answer 90 of the 400 questions. Does this provide evidence that B occurs at a different rate than what is expected if each question is equally likely?
Please run a hypothesis test to find out!
$\$
# step 1: state null and alternative hypotheses # step 2: compute observed statistic # step 3: create the null distribution # plot the null distribution # step 4: calculate the p-value # 5. decision? # FYI: You don't need to look at the actual data to solve this problem, # but if you'd like it can be loaded using: # APMultipleChoice <- Lock5Data::APMultipleChoice # Bonus, can you create a 95% CI for the proportion of answers that are B? answers <- Lock5Data::APMultipleChoice$Answer # Create the bootstrap distribution # visualize the bootstrap distribution # calculate the standard error and create a confidence interval
$\$
$\$
# State the null and alternative hypotheses in symbols and words # step 2: calculate the observed stat and visualize the data college <- read.csv("https://www.lock5stat.com/datasets3e/CollegeScores4yr.csv") public <- subset(college, Control == "Public") private <- subset(college, Control == "Private") public_CompRate <- public$CompRate private_CompRate <- private$CompRate # What's a good way to visualize the data for our question of interest? # calculate the observed statistic # step 3: # visualize the null distribution # Step 4: calculate the p-value # step 5: Conclusion?
$\$
$\$
# step 1: # step 2: observed stat library(fivethirtyeight) bechdel <- bechdel passed <- subset(bechdel, binary == "PASS") failed <- subset(bechdel, binary == "FAIL") passed_budget <- passed$budget_2013 failed_budget <- failed$budget_2013 # What's a good way to visualize the data for our question of interest? # step 3: # step 4: # step 5: Conclusion?
$\$
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.