Math 152 - Statistical Theory - Homework 10

Author

write your name here

Published

Invalid Date

Important Note:

You should work to turn in assignments that are clear, communicative, and concise. Part of what you need to do is not print pages and pages of output. Additionally, you should remove these exact sentences and the information about HW scoring below.

Click on the Knit to PDF icon at the top of R Studio to run the R code and create a PDF document simultaneously. [PDF will only work if either (1) you are using R on the network, or (2) you have LaTeX installed on your computer. Lightweight LaTeX installation here: https://yihui.name/tinytex/]

Either use the college’s RStudio server (https://rstudio.pomona.edu/) or install R and R Studio on to your personal computer. See: https://m152-stat-theory.netlify.app/syllabus.html for resources.

Assignment

Goals:

In this assignment, the fun will include:

  • size, power, and p-values
  • simple vs simple test
  • most powerful tests

Book problems

  • Feel free to do the book problems with a pencil or in LaTeX (RMarkdown supports writing mathematics using LaTeX).
  • If you use a pencil, you can take a picture of the problem(s), and include the image(s) using (remove the tick marks to make it work):
![](myimage.jpeg)
  • Note that myimage.jpeg needs to live in the same folder as the relevant .Rmd file (maybe you called the folder “math 152 hw” and put it on your desktop?)

  • Saving as jpg, jpeg, png, or pdf should work, but make sure to specify the exact name of the file.

  • If you have the 3rd edition of the book, the problems will be the same unless they don’t exist – that is, the 4th edition added problems but didn’t change the order of them. Ask me if you want to see the 4th edition problems.

Assignment

1: Community Q

Describe one thing you learned (not from lecture, maybe from working in pairs during class) from a member of the class (student, mentor, professor) – it could be: content, logistical help, background material, R information, etc. 1-3 sentences.

2: 9.1.13

Let X have the Poisson distribution with mean θ. Suppose that we wish to test the hypotheses:

H0:θ1.0,
H1:θ>1.0.

Let δc be the test that rejects H0 if Xc. Find c to make the size of δc as close as possible to 0.1 without being larger than 0.1.

Note: in R use ppois().

3: 9.1.14

Let X1,,Xn be i.i.d. with the exponential distribution with parameter θ. Suppose that we wish to test the hypotheses:

H0:θθ0,
H1:θ<θ0.

Let X=i=1nXi. Let δc be the test that rejects H0 if Xc.

  1. Show that π(θ|δc) is a decreasing function of θ.
  2. Find c in order to make δc have size α0.
  3. Let θ0=2, n=1, and α0=0.1. Find the precise form of the test δc and sketch its power function.

Note: θ(xi) Gamma(n,1)

4: 9.1.15

Let X have the uniform distribution on the interval [0,θ], and suppose that we wish to test the hypotheses

H0:θ1,
H1:θ>1.

We shall consider test procedures of the form “reject H0 if Xc.” For each possible value x of X, find the p-value if X=x is observed (that is, find the p-value as a function of x).

5: 9.2.2

Consider two pdfs f0(x) and f1(x) that are defined as follows:

f0(x)={1 for 0x1,0 otherwise,

and f1(x)={2x for 0x1,0 otherwise.

Suppose that a single observation X is taken from a distribution for which the pdf f(x) is either f0(x) or f1(x), and the following simple hypotheses are to be tested:

H0:f(x)=f0(x),
H1:f(x)=f1(x).

  1. Describe a test procedure for which the value of α(δ)+2β(δ) is a minimum.
  2. Determine the minimum value of α(δ)+2β(δ) attained by that test procedure.

Convince yourself that the theorems in 9.2 hold.

6: 9.2.4

Consider again the conditions of Exercise 9.2.2, but suppose now that it is desired to find a test procedure for which α(δ)0.1 and β(δ) is a minimum.

  1. Describe the test procedure.
  2. Determine the minimum value of β(δ) attained by the test procedure.

Convince yourself that the theorems in 9.2 hold.

7: 9.2.7

Suppose that X1,,Xn form a random sample from the normal distribution with known mean μ and unknown variance σ2, and the following simple hypotheses are to be tested:

H0:σ2=2,
H1:σ2=3.

  1. Show that among all test procedures for which α(δ)0.05, the value of β(δ) is minimized by a test procedure that rejects H0 when i=1n(Xiμ)2>c.
  2. For n=8, find the value of the constant c that appears in part a.

8: 9.2.8

Suppose that a single observation X is taken from the uniform distribution on the interval [0,θ], where the value of θ is unknown, and the following simple hypotheses are to be tested:

H0:θ=1,
H1:θ=2.

  1. Show that there exists a test procedure for which α(δ)=0 and β(δ)<1.
  2. Among all test procedures for which α(δ)=0, find the one for which β(δ) is a minimum.

9: R - kissing the right way

Most people are right-handed and even the right eye is dominant for most people. Molecular biologists have suggested that late-stage human embryos tend to turn their heads to the right. German biopsychologist Onur Güntürkün conjectured that this tendency to turn to the right manifests itself in other ways as well, so he studied kissing couples to see if both people tended to lean to their right more often than to their left (and if so, how strong the tendency is). He and his researchers observed couples from age 13 to 70 in public places such as airports, train stations, beaches, and parks in the United States, Germany, and Turkey. They were careful not to include couples who were holding objects such as luggage that might have affected which direction they turned. In total, 124 kissing pairs were observed with 80 couples leaning right (Nature, 2003). [Taken from Rossman & Chance, ISCAM]

Güntürkün wanted to test the belief that the probability of kissing to the right is 3/4; he thinks it is probably less than 3/4.

  1. Using the binomial distribution (not the CLT), find the rejection region for this test given a level of significance of 0.05. You can use trial and error (with pbinom()) or the quantile function for the binomial (qbinom()) to come up with your test.
# for X ~ Bin(size, prob)
size=124
prob=.75
q=2
p=.1
pbinom(q, size, prob)     # gives P(X < = q)
[1] 1.525648e-70
dbinom(q, size, prob)     # gives P(X=q)
[1] 1.517401e-70
qbinom(p, size, prob)     # gives the cutoff for a given probability, p
[1] 87
  1. What is the size of your test?

  2. Calculate and plot the power function over all possible values of θ. Do you think your test seems particularly powerful? Explain. (Note: you’ll need to change the code below to say eval = TRUE and also actually write out the power function.)

all.theta <-  seq(0,1,.001)
all.power <-  #somefunction of all.theta and n (size)#
plot(all.theta, all.power, xlab="possible theta values", ylab="power function")
  1. Given the data (80 couples kissed right), what is the p-value of the test?