---
title: "Stat 140 HW#5: SDM4 Chapters 11 -- 14"
author: "YOUR NAME GOES HERE"
date: "October 27, 2017"
output:
  html_document:
    fig_height: 3
    fig_width: 5
  pdf_document:
    fig_height: 2.8
    fig_width: 6
  word_document:
    fig_height: 3
    fig_width: 5
---


```{r include=FALSE}
# Don't delete this chunk if you are using the mosaic package
# This loads the mosaic and dplyr packages
require(mosaic); require(readr)
```

```{r include=FALSE}
# Some customization.  You can alter or delete as desired (if you know what you are doing).

# This changes the default colors in lattice plots.
trellis.par.set(theme=theme.mosaic())  

# knitr settings to control how R chunks work.
require(knitr)
opts_chunk$set(
  tidy=FALSE,     # display code as typed
  size="small"    # slightly smaller font for code
)
```

This homework is due at the start of class on Friday, October 27th.

### PRACTICE PROBLEMS (not to be turned in; may be helpful for exam review):

SDM4 11.1, 11.3, 11.5, 11.7, 11.9, 11.11, 11.13, 11.15, 11.17, 11.19, 11.31, 11.33, 11.35, 11.39, 11.43, 11.45

SDM4 12.1, 12.3, 12.5, 12.7, 12.9, 12.11, 12.13, 12.15, 12.17, 12.19, 12.21, 12.23, 12.25, 12.27, 12.43, 12.47, 12.57

SDM4 13.7, 13.11, 13.13, 13.15, 13.19, 13.21, 13.23, 13.25, 13.27, 13.31, 13.33, 13.37, 13.47, 13.49

SDM4 14.15, 14.17, 14.19, 14.23, 14.25, 14.27, 14.31, 14.33, 14.43, 14.45, 14.47, 14.49,
14.55, 14.59

### PROBLEMS TO TURN IN:

#### SDM4 11.34 (Survey questions)  Part b) only

Examine the following question for possible bias.  If you think the question is biased, indicate how and propose a better question.

b) Given that 18-year-olds are old enough to vote and to serve in the military, is it fair to set the drinking age at 21?

SOLUTION:



#### SDM4 11.36 (phone surveys)

Any time we conduct a survey, we must take care to avoid undercoverage.  Suppose we are interested in opinions about a local issue among city residents.  We plan to select 500 names from the city phone book, call their homes between noon and 4pm, and interview whoever answers, anticipating contacts with at least 200 people.

a) Why is a simple random sample difficult to use here?

SOLUTION:



b) What kinds of households are likely to be excluded?  What kinds of households are likely to be included in the eventual sample of opinion?  

SOLUTION:



c) Describe a sampling strategy that is more convenient than taking a simple random sample, but is still a random sampling strategy.

SOLUTION:
s


d) Suppose, instead, that we continue calling each number, perhaps in the morning or evening, until an adult is contacted and interviewed.  How does this improve the sampling design?

SOLUTION:



e) Random-digit dialing machines can generate the phone calls for us.  How would this improve our design?  Is anyone still excluded?

SOLUTION:



#### SDM4 12.24

Is diet or exercise effective in combating insomnia?  Some believe that cutting out desserts can help alleviate the problem, while others recommend exercise.  Forty volunteers suffering from insomnia agreed to participate in a month-long test.  Half were randomly assigned to a special no-desserts diet; the others continued desserts as usual.  Half of the people in each of these groups were randomly assigned to an exercise program, while the others did not exercise.  Those who ate no desserts and engaged in exercise showed the most improvement.

You should write only 1 or 2 sentences for each of the following parts!

a) Was this an observational study or an experiment?

SOLUTION:



If you said this was an observational study, do parts b) through e) below.  If you said this was an experiment, do parts t) through z) below.

b) (Only do this if you said this was an observational study in part a): Was this a retrospective study or a prospective study?

SOLUTION:



c) (Only do this if you said this was an observational study in part a): Who were the subjects studied and how were they identified?

SOLUTION:



d) (Only do this if you said this was an observational study in part a): What is the parameter of interest?

SOLUTION:



e) (Only do this if you said this was an observational study in part a): Discuss the nature and scope of the conclusions that can be reached from this study.

SOLUTION:



t) (Only do this if you said this was an experiment in part a): Who were the subjects studied?

SOLUTION:



u) (Only do this if you said this was an experiment in part a): What are the factor(s) in the experiment, and how many levels are there for each factor?

SOLUTION:



v) (Only do this if you said this was an experiment in part a): What is the number of treatments?

SOLUTION:



w) (Only do this if you said this was an experiment in part a): What is the response variable?

SOLUTION:



x) (Only do this if you said this was an experiment in part a): Was the design completely randomized?  Was blocking used?

SOLUTION:



y) (Only do this if you said this was an experiment in part a): Was blinding used?  If so, single blinding or double blinding?

SOLUTION:



z) (Only do this if you said this was an experiment in part a): Discuss the nature and scope of the conclusions that can be reached from this study.

SOLUTION:




#### SDM4 12.26

Researchers have linked an increase in the incidence of breast cancer in Italy to dioxin released by an industrial accident in 1976.  The study identified 981 women who lived near the site of the accident and were under age 40 at the time.  Fifteen of the women had developed breast cancer at an unsually young average age of 45.  Medical records showed that they had heightened concntrations of dioxin in their blood and that each tenfold increase in dioxin level was associated with a doubling of the risk of breast cancer. (Source: *Science News*, Aug. 3, 2002).

You should write only 1 or 2 sentences for each of the following parts!

a) Was this an observational study or an experiment?

SOLUTION:



If you said this was an observational study, do parts b) through e) below.  If you said this was an experiment, do parts t) through z) below.

b) (Only do this if you said this was an observational study in part a): Was this a retrospective study or a prospective study?

SOLUTION:



c) (Only do this if you said this was an observational study in part a): Who were the subjects studied and how were they identified?

SOLUTION:



d) (Only do this if you said this was an observational study in part a): What is the parameter of interest?

SOLUTION:



e) (Only do this if you said this was an observational study in part a): Discuss the nature and scope of the conclusions that can be reached from this study.

SOLUTION:



t) (Only do this if you said this was an experiment in part a): Who were the subjects studied?

SOLUTION:



u) (Only do this if you said this was an experiment in part a): What are the factor(s) in the experiment, and how many levels are there for each factor?

SOLUTION:



v) (Only do this if you said this was an experiment in part a): What is the number of treatments?

SOLUTION:



w) (Only do this if you said this was an experiment in part a): What is the response variable?

SOLUTION:



x) (Only do this if you said this was an experiment in part a): Was the design completely randomized?  Was blocking used?

SOLUTION:



y) (Only do this if you said this was an experiment in part a): Was blinding used?  If so, single blinding or double blinding?

SOLUTION:



z) (Only do this if you said this was an experiment in part a): Discuss the nature and scope of the conclusions that can be reached from this study.

SOLUTION:







#### SDM4 13.46 (The train)

To get to work, a commuter must cross train tracks.  The time the train arrives varies slightly from day to day, but the commuter estimates he'll get stopped on about 15% of work days.  Let's assume that the events of being stopped on different days are independent.  

Define the events A = stopped on Monday, B = stopped on Tuesday, C = stopped on Wednesday, D = stopped on Thursday, and E = stopped on Friday.

During a certain 5-day work week, what is the probability that he:

a) gets stopped on Monday and again on Tuesday

SOLUTION:



b) gets stopped for the first time on Thursday

SOLUTION:



c) gets stopped every day

SOLUTION:



d) gets stopped at least once during the week?  (**Hint**: consider using the complement rule)

SOLUTION:



#### Language and Poverty in the United States

The American Community Survey is an ongoing survey that provides data every year to give communities the current information they need to plan investments and services. The 2010 American Community Survey estimates that 14.6\% of Americans live below the poverty line, 20.7\% speak a language other than English (foreign language) at home, and 4.2\% fall into both categories.

Define the events A = a randomly selected American lives below the poverty line and B = a randomly selected American speaks a language other than English at home.

a) Are living below the poverty line and speaking a foreign language at home 
disjoint?

SOLUTION:



b) What is the probability that a randomly selected American lives below the poverty line or speaks a language other than English at home (or both)?

SOLUTION:



c) What is the probability that a randomly selected American lives below the poverty line and only speaks English at home?

SOLUTION:





d) Is the event that someone lives below the poverty line independent of the event that the person speaks a foreign language at home?

SOLUTION:





#### SDM4 14.28 (Sick cars)

Twenty percent of cars that are inspected have faulty pollution control systems.  The cost of repairing a pollution control system exceeds \$100 about 40% of the time.  When a driver takes their car in for inspection, what's the probability that they will have to pay more than \$100 to repair the pollution control system?

SOLUTION:



#### SDM4 14.56 (No shows)

An airline offers discounted "advance-purchase" fares to customers who buy tickets more than 30 days before travel and charges "regular" fares for tickets purchased during those last 30 days.  The company has noticed that 60% of its customers take advantage of the advance-purchase fares.  The "no-show" rate among people who paid regular fares is 30%, but only 5% of customers with advance-purchase tickets are no-shows.

a) What is the probability that a randomly selected ticket holder will be a no show?

SOLUTION:



b) What's the probability that a customer who didn't show had an advance-purchase ticket?

SOLUTION:



c) Is being a no-show independent of the type of ticket a passenger holds?  Explain.

SOLUTION:



#### SDM4 14.60 (Polygraphs)

Lie detectors are controversial instruments, barred from use as evidence in many courts.  Nonetheless, many employers use lie detector screening as part of their hiring process in the hope that they can avoid hiring peple who might be dishonest.  There has been some research, but no agreement, about the reliability of polygraph tests.  Based on this research, suppose that a polygraph can detect 65% of lies, but incorrectly identifies 15% of true statements as lies.

A certain company assumes that 95% of its applicants are trustworthy.  The company gives everyone a polygraph test, asking "Have you ever stolen anything from your place of work?"  Naturally, all the applicants answer "No," but the polygraph identifies some of those answers as lies, making the person ineligible for a job.  What's the probability that a job applicant rejected under suspicion of dishonesty was actually trustworthy?

**Hint**: Define the events A = individual was telling the truth, and B = the polygraph test says the individual was lying.  From the problem statement, what are $P(A)$, $P(B | A)$, and $P(B | A^c)$?  Make a probability tree diagram.

SOLUTION:


