The ASTA team
The \(p\)-value is the probability of observing a more extreme value of \(T\) (if we were to repeat the experiment) than \(t_{obs}\) under the assumption that \(H_0\) is true.
“Extremity” is measured relative to the alternative hypothesis; a value is considered extreme if it is “far from” \(H_0\) and “closer to” \(H_a\).
If the \(p\)-value is small then there is a small probability of observing \(t_{obs}\) if \(H_0\) is true, and thus \(H_0\) is not very probable for our sample and we put more support in \(H_a\), so:
\[ \textbf{The smaller the $p$-value, the less we trust $H_0$.} \]
## [1] 0.07757725
The book also discusses one-sided \(t\)-tests for the mean, but we will not use those in the course.
count <- 1200 * 0.52 # number of individuals preferring tax increase
prop.test(x = count, n = 1200, correct = F)
##
## 1-sample proportions test without continuity correction
##
## data: count out of 1200
## X-squared = 1.92, df = 1, p-value = 0.1659
## alternative hypothesis: true p is not equal to 0.5
## 95 percent confidence interval:
## 0.4917142 0.5481581
## sample estimates:
## p
## 0.52
## [1] 0.04005255
sex
.Chile <- read.delim("https://asta.math.aau.dk/datasets?file=Chile.txt")
binom.test( ~ sex, data = Chile, p = 0.5, conf.level = 0.95)
##
##
##
## data: Chile$sex [with success = F]
## number of successes = 1379, number of trials = 2700, p-value = 0.2727
## alternative hypothesis: true probability of success is not equal to 0.5
## 95 percent confidence interval:
## 0.4916971 0.5297610
## sample estimates:
## probability of success
## 0.5107407
(note the additional argument correct = FALSE
).