heart

reference:
- Tintle, et al., ISI, example 1.3, p. 48

hypotheses

Define \(\pi\).

SOLUTION:

\[H_0 : \pi = 0.15\] \[H_a : \pi > 0.15\]

State the values of \(\pi\) and \(\alpha\)

pi <- 0.15        # probability of success
alpha <- 0.05     # level of significance

observed statistic

x <- 8                # number of successes
n <- 10               # sample size
(p.hat.observed <- x / n)
## [1] 0.8

data

heart <- data.frame(response = c("died", "lived"),
                    p = c(p.hat.observed, 1 - p.hat.observed))
heart
##   response   p
## 1     died 0.8
## 2    lived 0.2
str(heart)
## 'data.frame':    2 obs. of  2 variables:
##  $ response: Factor w/ 2 levels "died","lived": 1 2
##  $ p       : num  0.8 0.2
ggplot(heart, aes(response, p, fill = response)) +
  geom_bar(stat = "identity") +
  scale_fill_manual(values = c("powderblue", "thistle")) +
  labs(title = "Heart")