Statistic homework
10/6/2020 Stat 311, HW1
file:///C:/Users/Ranjini/Documents/STAT 311Materials/Homework/HW1Autumn2020.html 1/4
Reading
Exercise 1: Data Sense
Exercise 2: Biased Sampling Design
Exercise 3. Problem 1.30 on page 35.
Exercise 4
Stat 311, HW1 Your Name
Instructions This homework is due on Wednesday, October 14 by midnight PST. The drop box will remain open till noon Thursday October 15. However, any work submitted during this period will be subject to a 50% late penalty. No late work will be accepted after this grace period.
You can open a copy of this rmarkdown �le on the [Rstudio server] (https://www.rstudio.stat.washington.edu/auth-sign-in (https://www.rstudio.stat.washington.edu/auth-sign-in)) by typing stat311::load('hw1') at the prompt in the console window.
Please answer ALL questions in the locations marked in this template by deleting the prompt where you answer should be and then typing your answer.
Remember to periodically knit your document to check that the output appears as you want it to.
You will need to upload both the .Rmd �le and also the knitted .html �le in CANVAS. Here are the instructions for downloading these �les to your laptop from the server:
Check the box next to the �le you want to download in the File pane.
Then click on More /-> Export to download them to your computer.
Save the �les on your computer, preferably in a folder called stat311 and give them descriptive names like homework1.Rmd for instance.
Please answer all questions in the order in which they are posed. Write in complete sentences, and ALWAYS support your answers unless speci�cally noted otherwise.
Reading Sections 1.2, 1.3, 1.4 in Openintro (4th Addition)
Code
Instructions
10/6/2020 Stat 311, HW1
file:///C:/Users/Ranjini/Documents/STAT 311Materials/Homework/HW1Autumn2020.html 2/4
Exercise 1: Data Sense To help you think more critically. Be sure to CLEARLY explain your thinking.
a. Ads for ADT Security System claim:
when you go on vacation, burglars go to work… According to FBI statistics, over 25% of home burglaries occur between Memorial Day and Labor Day.
Should we be surprised that as many as 25% of burglaries occur in this time period?
Yes or no, and write a couple of sentences to explain
b. According to an article on king5.com (https://www.king5.com/article/news/health/coronavirus/car-thieves-taking-advantage-of- washingtons-stay-home-orders-coronavirus/281-cb038afe-e9b0-41b3-a238-0853dba1e351), 61 vehicles were stolen in 48 hours in King County, and 18 vehicles were stolen in the same time frame in Pierce County.
Can we conclude that Pierce County residents are more law abiding? Or is something missing from the equation?
Yes or no, and write a couple of sentences to explain
c. Diastolic blood pressure is considered a better indicator of heart trouble than systolic blood pressure. Data for a large representative sample of men ages 45 and over was studied by the Public Health Service. The average diastolic pressure decreased steadily with age: 77 mmHg at 45 years to 65 mmHg at 85 years. Yes or no and explain: this data shows that a person’s blood pressure can decrease with age.
Yes or no, and write a couple of sentences to explain
d. An opinion post (https://www.nytimes.com/2020/06/24/opinion/trump-coronavirus.html) in the New York Times on June 24, 2020 claimed that the U.S. was doing a terrible job at �attening the curve compared to other a few other countries. In particular, the number of covid cases in the U.S. in June appears to be rising to mid April levels in the graph shown below. What’s missing in this comparison though? (Hint: the COVID cases in April were mainly sick people, but the cases in June included many asymptomatic individuals. Why? This is the missing factor. )
10/6/2020 Stat 311, HW1
file:///C:/Users/Ranjini/Documents/STAT 311Materials/Homework/HW1Autumn2020.html 3/4
Exercise 2: Biased Sampling Design Each of the sampling designs below is biased. State why.
a. A study in El Paso, Texas, looked at seat belt use by drivers. Drivers were observed at many convenience stores in the city. After they left their cars, they were invited to participate in a survey that included questions about seat belt use. In all, 75% said they always used seat belts.
Write your answer here
b. A graduate student conducts a research project about how adult Americans send thank you notes. She uses the U.S. Postal Service to mail a survey to 500 adults that she knows and asks them to mail back a response to the question `` Do you prefer to send thank you notes by email or snail mail (the U.S. Postal Service)?’’
Write your answer here
c. A wildlife biologist samples lakes in a state by dropping grains of rice onto a map of the state and then selects for study the lakes that have rice on them. He is interested in estimating the abundance of a particular kind of �sh in the lakes.
Write your answer here
d. The Museum of Fine Arts in Boston wants to estimate what proportion of people who come to Boston from out of town planned their trip to Boston mainly to visit the museum. The sample will consist of all out-of-town visitors to the museum on several randomly selected days. On buying a ticket to the museum, people will be asked whether they came from out of town, and if so, what the main reason for their visit was.
Write your answer here
Exercise 3. Problem 1.30 on page 35. Write answer here
Exercise 4 In this question we will work with the county_complete data from the openintro package and used in exercise 1.40 on page 37 of the text. Copy and paste the two lines of code in your console window. This will attach (or load) the tidyverse and openintro packages to the working environment.
a. Now run the following command to load the data. It should appear in your Environment pane. Examine the dataset by clicking on it. What is a case?
Hide
library(tidyverse) library(openintro)
Hide
data(county_complete)
10/6/2020 Stat 311, HW1
file:///C:/Users/Ranjini/Documents/STAT 311Materials/Homework/HW1Autumn2020.html 4/4
Write answer here
b. There are 142 variables in this data set! Look through the codebook for the dataset and pick and name a categorical variable. Is it nominal or ordinal? (Hint: see the ggplot tutorial if you don’t remember how to access the codebook of a dataset.)
Write answer here
c. Make a scatter plot of the relationship between per-capita income (in 1000s of dollars) and the percentage of the population with a bachelor’s degree in 2017. The respective variables are per_capita_income_2017 and bachelors_2017 . Color all the points blue in your scatter plot.
Write your code in the code chunk below with the explanatory on the x axis and the response on the y axis. Run it and then answer the questions that follow.
i. Describe the relationship between the two variables. Is it positive or negative? Is it strong or weak?
Write answer here
ii. One possible explanation for the relationship between the % of bachelor’s degrees in a state and income is that having a bachelor’s degree can in fact increase income. But there are other possibilities. Use the language of confounding variables to give an alternate explanation. (Hint: clearly state a third variable de�ned on the observational unit and how it plays a role. )
Write answer here
d. In the code chunk below, use mutate to create and add a new variable called pop_change which represents the change in population from 2013 ( pop2013 ) to 2017 ( pop2017 ). Run the code and examine whether county_complete has the new variable tacked on to it at the end.
e. Create a subset of the data, call it rich_cases , which contains the cases with per_capita_2017 above $60,000. Name these cases.
Hide
##enter code to create scatter plot
Hide
##enter code to create a new variable