Lab 7 - Inference for proportions and means
Getting started
Use these steps to navigate to the STA101 version of
RStudio
using the Duke Container Manager;Use these steps to download all of the lab 7 files from our Canvas page, upload them to your
RStudio
files, and move them into an appropriately named folder (lab-7
, for instance);Once
lab-7.qmd
is where it needs to be, open it, and verify that you can click the “Render” button inRStudio
and get a PDF file. See this answer on Ed if you want more guidance here;Now proceed to complete the exercises in this lab.
Pointers
- For all visualizations you create, be sure to include informative titles for the plot, axes, and legend;
- Respond in complete sentences as much as possible;
- Be sure to observe good code style:
- There is a line break after each
|>
in a pipeline or+
in a ggplot; - There are spaces around
=
signs; - There is a space after each
,
; - Code is properly indented;
- Code doesn’t exceed 80 characters in each line, longer lines of code are spread across multiple lines with appropriately placed line breaks (so in the rendered PDF, your code shouldn’t run off the page);
- Code chunks are labeled, informatively and without spaces.
- There is a line break after each
Packages
Part 2: Course scores
Students in large university course that is offered each semester average 32 (out of 50) on the midterm, with a standard deviation of 4. The scores are distributed normally.
Exercise 4
What is the probability a randomly selected student scored less than 28?
What is the probability a randomly selected student scored higher than than 35?
What score did only 20 percent of the class exceed?
Exercise 5
I pick 10 students at random from the class.
[Without looking at the next question] How does the standard error of their average score compare to the standard deviation of the population of all STA 101 students? Explain your reasoning.
The standard error of the mean can be calculated as \(SE = \frac{\sigma}{\sqrt{n}}\). What is the probability the average midterm score of these 10 students is less than 28?
What is the probability the average midterm score of these 10 students is higher than 35?
How do the probabilities you calculated in the previous two questions (less than 28 and higher than 35) compare to the probabilities you calculated in Exercise 4? Why?
Now that you’ve completed the first part of the exercises, pause and render your document. If it renders without any issues, great! Move on to the next exercise. If it does not, debug the issue before moving on. Ask for help from your TA if you need. Do not proceed without rendering your document.
Part 3: IMS exercises
The exercises in this section do not require code. Make sure to answer the questions in full sentences.
Exercise 6
IMS - Chapter 16 exercises, #2: Married at 25.
Exercise 7
IMS - Chapter 16 exercises, #5: If I fits, I sits, bootstrap test.
Exercise 8
IMS - Chapter 16 exercises, #6: Legalization of marijuana, bootstrap test.
Exercise 9
IMS - Chapter 16 exercises, #8: Legalization of marijuana, standard errors.
Exercise 10
IMS - Chapter 16 exercises, #22: Legalization of marijuana, mathematical interval.
Lastly
Recommend some music for us to listen to while we grade this.
Wrap up
Submitting
Before you proceed, first, make sure that you have updated the document YAML with your name! Then, render your document one last time, for good measure.
To submit your assignment to Gradescope:
Go to your Files pane and check the box next to the PDF output of your document (
lab-7.pdf
).Then, in the Files pane, go to More > Export. This will download the PDF file to your computer. Save it somewhere you can easily locate, e.g., your Downloads folder or your Desktop.
Go to the course Canvas page and click on Gradescope and then click on the assignment. You’ll be prompted to submit it.
Mark the pages associated with each exercise. All of the papers of your lab should be associated with at least one question (i.e., should be “checked”).
If you fail to mark the pages associated with an exercise, that exercise won’t be graded. This means, if you fail to mark the pages for all exercises, you will receive a 0 on the assignment. The TAs can’t mark your pages for you, and for them to be able to grade, you must mark them.
Grading
The lab will be graded out of 50 total points.