def 小児科医():

かけだし小児科医が仕事の合間にプログラミングを勉強するブログです。

Study for Statistics Test Level 2 (11)

previous page↓

 

defpediatric.hatenablog.com

Today's study is on "Hypothesis testing".

 

Hypothesis Testing

Null Hypothesis and Alternative Hypothesis

The null hypothesis asserts that there is no significant difference or effect.

When a rare probability event is observed under the null hypothesis, the hypothesis is considered false.

If the probability of the event is smaller than the significance level (commonly set at 0.05 or 0.01), the null hypothesis is rejected.

The hypothesis that opposes the null hypothesis is termed the alternative hypothesis.

If the null hypothesis is rejected, it suggests the alternative hypothesis is correct. However, if the null hypothesis is accepted, it doesn't prove its correctness.

Alternative hypotheses can be two-sided or one-sided.

Test Statistic and Rejection Region

The mean or ratio of a sample used in testing is termed the "test statistic."

If there's a range within which the null hypothesis is rejected for the test statistic, this range is called the rejection region (opposite of the acceptance region).

The p-value represents the probability that the test statistic will have a value rarer than the observed value.

Classification of Hypotheses

Hypothesis testing methods can be classified as follows:

One Sample Problem

Population variance known (z-test)

\[ \bar{X} < \mu - 1.96 \times \frac{σ}{\sqrt{n}} \] \[ \bar{X} > \mu + 1.96 \times \frac{σ}{\sqrt{n}} \]

 

\[ \bar{X} > \mu + 1.645 \times \frac{σ}{\sqrt{n}} \]

*level of significance=0.05

 

Population variance unknown (t-test)

Use unbiased variance in place of variance when population variance is unknown.

This formula doesn't follow a normal distribution but a t-distribution.

Two Sample Problem

Population variance known (z-test)
  • Paired
    The z-test is conducted similarly to the one-sample problem.
  • Unpaired

\[ \begin{align*} Z &= \frac{(\bar{X}_1 - \bar{X}_2)}{\sqrt{\frac{σ_1^2}{n_1} + \frac{σ_2^2}{n_2}}} \\ \end{align*} \]

Population variance unknown(z test)
  • When population variances are equal

\[ \begin{align*} t &= \frac{(\bar{X}_1 - \bar{X}_2)}{s_p \sqrt{\frac{1}{n_1} + \frac{1}{n_2}}} \\ s_p &= \sqrt{\frac{(n_1 - 1) s_1^2 + (n_2 - 1) s_2^2}{n_1 + n_2 - 2}} \\ \end{align*} \]

  • When population variances are unequal(Welch's test)

\[ \begin{align*} t &= \frac{\bar{X}_1 - \bar{X}_2}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}} \\ \nu &\approx \frac{\left(\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}\right)^2}{\frac{(s_1^2/n_1)^2}{n_1-1} + \frac{(s_2^2/n_2)^2}{n_2-1}} \\ \end{align*} \]

 

Today's study session has concluded.