Hypothesis tests · Testes de hipótese
| English | Português |
|---|---|
| hypothesis test/haɪˈpɒθəsɪs test/ | teste de hipótese |
| null hypothesis/nʌl haɪˈpɒθəsɪs/ | hipótese nula |
| alternative/ɔːlˈtɜːnətɪv/ | alternativa |
| one-tailed/wʌn teɪld/ | unilateral |
| two-tailed/tuː teɪld/ | bilateral |
| significance level/sɪɡˈnɪfɪkəns ˈlevl/ | nível de significância |
| test statistic/test stəˈtɪstɪk/ | estatística de teste |
| rejection region/rɪˈdʒekʃn ˈriːdʒn/ | região de rejeição |
| critical value/ˈkrɪtɪkl ˈvæljuː/ | valor crítico |
| Type I error/taɪp aɪ ˈerə/ | erro do Tipo I |
| Type II error/taɪp ˈtuː ˈerə/ | erro do Tipo II |
The courtroom of statistics
- A drug company claims their new medicine works better than the old one. How do you decide if the evidence is strong enough?
- Hypothesis testing 假设检验 is the statistical equivalent of a courtroom: you assume the defendant (the null hypothesis 原假设) is innocent until proven guilty beyond reasonable doubt.
O tribunal da estatística
- Uma empresa farmacêutica afirma que seu novo remédio funciona melhor que o antigo. Como decidir se a evidência é forte o suficiente?
- Teste de hipóteses 假设检验 é o equivalente estatístico de um tribunal: você assume que o réu (a hipótese nula 原假设) é inocente até prova contrária além de dúvida razoável.
Setting up the hypotheses
- A hypothesis test uses sample data to judge a claim.
- The null hypothesis $H_0$ — the default position (usually "no change" or "no effect").
- The alternative 备择假设 $H_1$ — what you suspect is true.
- One-tailed 单尾 if $H_1$ points one way ($\mu > 50$); two-tailed 双尾 if both ($\mu \neq 50$).
Worked example. A machine fills bottles with 500 mL. You suspect it's underfilling. $H_0: \mu = 500$ (machine is correct). $H_1: \mu < 500$ (underfilling). This is a one-tailed test.
A two-tailed 5% test rejects H0 in the shaded tails beyond plus or minus 1.96
Configurando as hipóteses
- Um teste de hipóteses usa dados amostrais para julgar uma afirmação.
- A hipótese nula $H_0$ — a posição padrão (geralmente "sem mudança" ou "sem efeito").
- A alternativa 备择假设 $H_1$ — o que você suspeita ser verdadeiro.
- Unilateral 单尾 se $H_1$ aponta em uma direção ($\mu > 50$); bilateral 双尾 se ambas ($\mu \neq 50$).
Exemplo resolvido. Uma máquina enche garrafas com 500 mL. Você suspeita que está enchendo menos. $H_0: \mu = 500$ (a máquina está correta). $H_1: \mu < 500$ (enchimento insuficiente). Este é um teste unilateral.

Um teste bilateral de 5% rejeita H0 nas caudas sombreadas além de mais ou menos 1.96
The rejection region · A região de rejeição
reject H₀ if z < −z* · rejeite H₀ se z < −z*
The shaded tail is the rejection region — if the test statistic lands there, reject H₀. · A cauda sombreada é a região de rejeição — se a estatística de teste cair lá, rejeite H₀.
The null hypothesis H₀ usually states that: · A hipótese nula H₀ geralmente afirma que:
H₀ is the claim being tested, usually "no change"; H₁ is the suspected alternative. · H₀ é a reivindicação sendo testada, geralmente "nenhuma mudança"; H₁ é a alternativa suspeita.
If H₁ states μ > 50, the test is: · Se H₁ afirma μ > 50, o teste é:
H₁ pointing in one direction (μ > 50 or μ < 50) makes it a one-tailed test. · H₁ apontando em uma direção (μ > 50 ou μ < 50) o torna um teste unilateral.
Running the test
- Fix a significance level 显著性水平 (often 5%), compute a test statistic 检验统计量, and see if it lands in the rejection region 拒绝域.
- If $|z|$ exceeds the critical value 临界值 (1.96 for 5% two-tailed, 1.645 for 5% one-tailed), reject $H_0$.
A one-tailed test at 5% rejects H₀ only if the test statistic lands in the shaded tail.
Significance level is NOT the probability that $H_0$ is true. A 5% significance level means: if $H_0$ is true, there's a 5% chance of getting data this extreme. It does NOT mean there's a 5% chance $H_0$ is true.
Realizando o teste
- Defina um nível de significância 显著性水平 (muitas vezes 5%), calcule uma estatística de teste 检验统计量 e veja se ela cai na região de rejeição 拒绝域.
- Se $|z|$ exceder o valor crítico 临界值 (1.96 para 5% bilateral, 1.645 para 5% unilateral), rejeite $H_0$.

Um teste unilateral a 5% rejeita H₀ apenas se a estatística de teste cair na cauda sombreada.
O nível de significância NÃO é a probabilidade de que $H_0$ seja verdadeira. Um nível de significância de 5% significa: se $H_0$ for verdadeira, há 5% de chance de obter dados tão extremos. Isso NÃO significa que há 5% de chance de $H_0$ ser verdadeira.
Types of error
- Type I error 第一类错误: rejecting $H_0$ when it is true (false positive). Probability = significance level $\alpha$.
- Type II error 第二类错误: accepting $H_0$ when it is false (false negative).
Tipos de erro
- Erro Tipo I 第一类错误: rejeitar $H_0$ quando ele é verdadeiro (falso positivo). Probabilidade = nível de significância $\alpha$.
- Erro Tipo II 第二类错误: aceitar $H_0$ quando ele é falso (falso negativo).
A Type I error is: · Um erro Tipo I é:
Type I = reject a true H₀; Type II = accept a false H₀. · Tipo I = rejeitar uma H₀ verdadeira; Tipo II = aceitar uma H₀ falsa.
A Type II error means accepting H₀ when it is actually false. · Um erro Tipo II significa aceitar H₀ quando ela é realmente falsa.
Type II = fail to reject a false H₀ (false negative). · Tipo II = deixar de rejeitar uma H₀ falsa (falso negativo).
Worked example — z-test
- $H_0: \mu = 50$, $H_1: \mu \neq 50$ (two-tailed, 5% level). $\sigma = 8$, $n = 64$, $\bar{x} = 52$.
- $z = \dfrac{52 - 50}{8/\sqrt{64}} = \dfrac{2}{1} = 2$.
- Critical value for 5% two-tailed: $1.96$. Since $2 > 1.96$, reject $H_0$.
- Set a null and alternative hypothesis; the test statistic falls in the critical region (reject) or the acceptance region. A Type II error is accepting a false $H_0$. Tests may use a binomial or Poisson distribution.
Exemplo resolvido — teste z
- $H_0: \mu = 50$, $H_1: \mu \neq 50$ (bilateral, nível de 5%). $\sigma = 8$, $n = 64$, $\bar{x} = 52$.
- $z = \dfrac{52 - 50}{8/\sqrt{64}} = \dfrac{2}{1} = 2$.
- Valor crítico para bilateral de 5%: $1.96$. Como $2 > 1.96$, rejeite $H_0$.
- Defina uma hipótese nula e alternativa; a estatística de teste cai na região crítica (rejeita) ou na região de aceitação. Um Erro Tipo II é aceitar um $H_0$ falso. Os testes podem usar uma distribuição binomial ou Poisson.
Population mean claimed 50, σ = 8, sample n = 64, x̄ = 52. What is z = (x̄ − μ)/(σ/√n)? · Média populacional alegada 50, σ = 8, amostra n = 64, x̄ = 52. Qual é z = (x̄ − μ)/(σ/√n)?
z = (52 − 50)/(8/√64) = 2/(8/8) = 2/1 = 2.
For a 5% two-tailed test, you reject H₀ if |z| > 1.96. · Para um teste bilateral de 5%, você rejeita H₀ se |z| > 1.96.
The critical value for a 5% two-tailed test is 1.96. If |z| exceeds this, reject H₀. · O valor crítico para um teste bilateral de 5% é 1.96. Se |z| exceder isso, rejeite H₀.
You've got it
- $H_0$ (no change) vs $H_1$ (suspected); one- or two-tailed
- test statistic $z = \dfrac{\bar{x} - \mu}{\sigma/\sqrt{n}}$; reject $H_0$ if it's in the rejection region
- Type I = reject a true $H_0$; Type II = accept a false $H_0$
Entendeu?
- $H_0$ (sem mudança) vs $H_1$ (suspeitado); unilateral ou bilateral
- estatística de teste $z = \dfrac{\bar{x} - \mu}{\sigma/\sqrt{n}}$; rejeite $H_0$ se estiver na região de rejeição
- Erro Tipo I = rejeitar um $H_0$ verdadeiro; Erro Tipo II = aceitar um $H_0$ falso