--- title: "Math 152 - Statistical Theory - Homework 8" author: "write your name here" date: "Due: 11/9/2018" output: pdf_document --- ```{r global_options, include=FALSE} knitr::opts_chunk$set(message=FALSE, warning=FALSE, fig.height=3, fig.width=5, fig.align = "center") library(dplyr) library(ggplot2) library(readr) library(broom) options(digits=5) ``` #### Book problems: 9.1 -- 1, 6, 9, 13 (use either the table in the back of your book or the R functions **qpois** and **ppois**, see below for related binomial probabilities), 14 [note: $\theta * \sum(x_i) \sim$ Gamma(n,1)], 15 #### R problem (a real hypothesis test!!) 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 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 or the inverse function for the binomial to come up with your test. ```{r} # for X ~ Bin(size, prob) size=124 prob=.75 q=2 p=.1 pbinom(q, size, prob) # gives P(X < = q) dbinom(q, size, prob) # gives P(X=q) qbinom(p, size, prob) # gives the cutoff for a given probability, p ``` 2. What is the size of your test? 3. Calculate and plot the power function over all possible values of $\theta$. Do you think your test seems particularly powerful? Explain. ```{r eval=FALSE} 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") ``` 4. Given the data (80 couples kissed right), what is the p-value of the test?