library(learnr) library(tidyverse) library(tutorialExtras) library(gradethis) gradethis_setup() knitr::opts_chunk$set(echo = FALSE)
grade_server("grade")
question_text("Name:", answer_fn(function(value){ if(length(value) >= 1 ) { return(mark_as(TRUE)) } return(mark_as(FALSE) ) }), correct = "submitted", allow_retry = FALSE )
grade_button_ui(id = "grade")
Complete this tutorial while reading Sections 9.5 - 9.7 of the textbook. Each question allows 3 'free' attempts. After the third attempt a 10% deduction occurs per attempt.
You can click the "View Grade" button as many times as you would like to see your current grade and the number of attempts you are on. Before submitting make sure your grade is as expected.
quiz( caption = NULL, # Question 1 question("Q1) Which of the following are appropriate standardized statistics? Select all that apply. Hint: use the info in Table 9.6.", answer("$( \\frac{\\bar{x}_1 - \\bar{x}_2}{\\sqrt{ \\frac{s^2_1}{n_1} +\\frac{s^2_2}{n_2} } })$", correct = TRUE), answer("$( \\frac{\\hat{\\pi}_1 - \\hat{\\pi}_2}{\\sqrt{ \\frac{s^2_1}{n_1} +\\frac{s^2_2}{n_2} } } )$"), answer("$( \\frac{\\hat{\\pi}}{\\sqrt{ \\frac{\\hat{\\pi}(1-\\hat{\\pi})}{n} } } )$", correct = TRUE), answer("$( \\frac{\\sqrt{n}\\bar{x}}{s} )$", correct = TRUE), allow_retry = TRUE, random_answer_order = TRUE), #Q2 question_blank("<strong> Q2) Consider the data frame `virtual_prop_red_100` that results from the following lines of code: </strong> <br/> `virtual_samples_100 <- bowl %>% rep_sample_n(size = 100, reps = 10000)` <br/> `virtual_prop_red_100 <- virtual_samples_100 %>% group_by(replicate) %>% summarize(red = sum(color == 'red')) %>% mutate(prop_red = red / 100)` <br/> a) How many rows will `virtual_prop_red_100` have? ___ <br/> b) What is the maximum possible value of the `red` column (even if it is highly unlikely)? ___ <br/> c) What is the maximum possible value of the `prop_red` column (even if it is highly unlikely)? ___ <br/> d) How many rows will have `replicate == 437`? ___", answer_fn(function(value){ if (value %in% c("10000", "10,000")) { return(mark_as(TRUE))} return(mark_as(FALSE) ) }), answer("100", correct = TRUE), answer("1", correct = TRUE), answer("1", correct = TRUE), allow_retry = TRUE), # Q3 question("Q3) Consider using shovels of size 200 and 75 to sample from the bowl of red and white balls. Which of the following are TRUE statements? Select all that apply.", answer("Using a shovel of size 200 would result in a larger standard error for proportions red, compared to using a shovel of size 75"), answer("Using a shovel of size 200 would result in there being more variation in estimates of proportion red, compared to using a shovel of size 75"), answer("Using a shovel of size 200 would give an estimate $\\hat{\\pi}$ that is likely to be closer to the true population parameter $\\pi$, compared to using a shovel of size 75", correct = TRUE), answer("Using a shovel of size 200 would result in the sampling distribution of $\\hat{\\pi}$ having a smaller standard deviation, compared to using a shovel of size 75", correct = TRUE), allow_retry = TRUE, random_answer_order = TRUE), # Q4 question("Q4) Which of the following are TRUE about the theory of repeated samples? Select all that apply.", answer("It is a purely theoretical construct - you will not observe repeated samples in real life", correct = TRUE), answer("It provides the theory for how we can connect a sample estimate to the population parameter we care about", correct = TRUE), answer("It relies on the process of randomization (e.g. random sampling)", correct = TRUE), answer("It ensures that we will get a precise estimate of the population parameter"), answer("It helps us to determine if an estimator (e.g. $\\bar{x}$ or $s^2$) is unbiased", correct = TRUE), allow_retry = TRUE, random_answer_order = TRUE), # Q5 question_blank(paste0("<strong> Q5) Imagine that you have a random sample of students who took the SAT in Illinois, and you find the average SAT Math score in your sample to be $\\bar{x}$ = 527 and the standard deviation of SAT Math scores to be 100. </strong> <br/> What is the standard error of your estimate $\\bar{x}$ if your sample has 100 students? ___ <br/> What is the standard error of your estimate $\\bar{x}$ if your sample has 400 students? ___ <br/> Which sample size (100 or 400) gives a more precise estimate? ___"), answer("10", correct = TRUE), answer("5", correct = TRUE), answer("400", correct = TRUE), allow_retry = TRUE), # Question 10 question("Q6) Which of the following are TRUE statements about $\\bar{x}$? Select all that apply. ", answer("In large enough samples, it will be normally distributed, even if the underlying data is skewed", correct = TRUE), answer("Its sampling distribution will become wider as sample size increases"), answer("Its standard error depends on the sample size", correct = TRUE), answer("Its sampling distribution will be centered around the true population mean ($\\mu$)",correct=TRUE), allow_retry = TRUE, random_answer_order = TRUE) )
Once you are finished:
grade_print_ui("grade")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.