<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />

# Testing a Hypothesis for Dependent and Independent Samples

## Calculations for two samples of data (both dependent or both independent) necessary to reject or accept the null hypothesis

0%
Progress
Practice Testing a Hypothesis for Dependent and Independent Samples
Progress
0%
Hypothesis Testing

Hypothesis testing involves testing the difference between a hypothesized value of a population parameter and the estimate of that parameter which is calculated from a sample.

There are six main steps of performing a Hypothesis Test.

1) Verify that necessary conditions are satisfied

For Significance Test for a Mean:

• The sampling method is simple random sampling.
• The sample is drawn from a normal or near-normal population.

For Significance Test for a Proportion:

• The sampling method is simple random sampling.
• Each sample point can result in just two possible outcomes. We call one of these outcomes a success and the other, a failure.
• The sample includes at least 10 successes and 10 failures.
• The population size is at least 10 times as big as the sample size.

2) Determine the Null and Alternative Hypotheses

In statistics, the hypothesis to be tested is called the null hypothesis and given the symbol $H_0$.  The alternative hypothesis is given the symbol $H_a$.

Consider

$H_0: \mu & = 3.2\\H_a: \mu & \neq 3.2$

This is called a two-tailed test.  In this situation, if our sample mean, $\bar{x}$, is much larger or much smaller than 3.2 we would reject $H_0$ .

Consider

This is called a one-tailed test.  In this situation, we would only reject $H_0$ if our sample mean, $\bar{x}$

3) Determine the level of significance

The numerical measure that we use to determine the strength of the sample evidence we are willing to consider strong enough to reject $H_0$ is called the level of significance and it is denoted by $\alpha$.  Most hypothesis tests use an $\alpha$ of .05.

4) Calculate the Test Statistic

For Significance Test for a Mean:

We calculate the test statistic by using the formula:

$z=\frac{(\bar{x}-\mu)}{\frac{\sigma}{\sqrt{n}}}$

where:

$z=$ standardized score

$\bar{x}=$ sample mean

$\mu=$ the population mean under the null hypothesis

$\sigma=$ population standard deviation. If we do not have the population standard deviation and if $n \ge 30$ , we can use the sample standard deviation, $s$.

For Significance Test for a Proportion:

We calculate the test statistic by using the formula:$z=\frac{\hat{p}-p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}$

where:

$n$ = sample size

$p_0$ = hypothesized value of the proportion under the null hypothesis

5) Calculate the P-Value

The p-value is the probability of obtaining the value of the test statistic we obtained in step 4 if the null hypothesis is true.

To determine the p-value we use the z-score probability table to calculate the probability that the test statistic is either less than or greater than the one we obtained in step 4.  If it is a two-tailed test, you must multiply this value by 2.

If the p-value is smaller than $\alpha$, then we reject the null hypothesis.  If the p-value is bigger than $\alpha$, we fail to reject the null hypothesis.

6) Make a Conclusion

To make a conclusion for the Hypothesis Test, you must do four things:

2. say whether you reject the null hypothesis or not
3. interpret your rejection or non-rejection of the null hypothesis in the context of the problem
4. say whether it is likely/unlikely that sample results were due to chance

Two Sample Tests

In addition to testing single samples associated with a mean, we can also perform hypothesis tests with two samples. We can test two independent samples (which are samples that do not affect one another) or dependent samples which assume that the samples are related to each other.

When testing a hypothesis about two independent samples, we follow a similar process as when testing one random sample.

Use the following for the Null Hypothesis:

$H_0: \mu_1=\mu_2 \ \text{or} \ H_0: \mu_1-\mu_2=0$

When computing the test statistic, we need to calculate the estimated standard error of the difference between sample means which is found by using the formula:

$se (\bar{x}_1-\bar{x}_2)=\sqrt{s^2 \left(\frac{1}{n_1}+\frac{1}{n_2}\right)} \ \text{with} \ s^2=\frac{ss_1+ss_2}{n_1+n_2-2}$

We carry out the test on the means of two independent samples in a similar way as the testing of one random sample. However, we use the following formula to calculate the test statistic:

$t=\frac{(\bar{x}_1-\bar{x}_2)-(\mu_1-\mu_2)}{s.e.(\bar{x}_1-\bar{x}_2)}$ with the standard error defined above.

We can also test the proportions associated with two independent samples . In order to calculate the test statistic associated with two independent samples, we use the formula:

$z=\frac{(\hat{p}_1-\hat{p}_2)-(0)}{\sqrt{\hat{p}(1-\hat{p}) \left(\frac{1}{n_1}+\frac{1}{n_2}\right)}} \ \text{with} \ \hat{p}=\frac{n_1 \hat{p}_1+n_2 \hat{p}_2}{n_1+n_2}$

We can also test the likelihood that two dependent samples are related.

Use the following for the Null Hypothesis:

$H_0: \delta=\mu_1-\mu_2$

To calculate the test statistic for two dependent samples, we use the formula:

$t=\frac{\bar{d}-\delta}{s_d} \ \text{with} \ s_d=\sqrt{\frac{\sum d^2 - \frac{(\sum d)^2}{n}}{n-1}}$