Source: Statistics for the Behavioral Sciences - Susan A. Nolan and Thomas Heinzen (with a few modifications)



Paired/Dependent T- test

The paired-samples t test (also called dependent-samples t test) is used to compare two means for situations in which every participant is in both samples (or situation of two set of units that are matched in pairs, for example, husbands and wives). Once you understand the single-sample t test, the paired-samples t test is simple. The major difference in the paired-samples t test is that we must create difference scores for every individual.

The steps are very similar to those for the ones we have seen before. The main difference is that we are comparing the sample mean difference between scores to that for the mean difference for the population according to the null hypothesis, rather than comparing the sample mean of individual scores to the population mean.

Example

Salary Wizard is an online tool that allows you to look up incomes for specific jobs for cities in the United State. We looked up the 25th percentile for income for six jobs in two cities: Boise, Idaho, and Los Angeles, California. The data are below.

##                                     Jobs Boise Los Angeles
## 1                         Executive chef 53047       62490
## 2                     Genetics counselor 49958       58850
## 3                 Grants/proposal writer 41974       49445
## 4                              Librarian 44366       52263
## 5                   Public schoolteacher 40470       47674
## 6 Social worker (with bachelor's degree) 36963       43542

How can we conduct a paired-samples t test to determine whether income in one of these cities differs, on average, from income in the other? We will use a two-tailed test and a significant level of 0.05.

Notice that the same individual (income for specific job) is measured twice (two different cities).

Step 1: Assumptions

For the one-sample t test, we use individual scores; for the paired-samples t test, we use difference scores. The comparison distribution is a distribution of mean difference scores (rather than a distribution of means).

Population 1: Job types in Boise, Idaho.
Population 2: Job types in Los Angeles, California

The comparison distribution will be a distribution of mean differences.

The hypothesis test will be a paired-samples t test because we have two samples, and all participants are in both samples.

We do not know whether the population is normally distributed, there are only 12 observations in total, and there is not much variability in the data in our samples, so we should proceed with caution. The data were not randomly selected, so we should be cautious when generalizing beyond this sample of job types.

Step 2: State the null and alternative hypotheses.

Remember, hypotheses are always about populations, not about our specific samples.

Null hypothesis: Jobs in Boise pay the same, on average, as jobs in Los Angeles: \[H_0: \mu_1 = \mu_2\]

Alternative hypothesis: Jobs in Boise pay different incomes, on average, from jobs in Los Angeles

\[H_a: \mu_1 \neq \mu_2\]

Step 3: Determine the characteristics of the comparison distribution

With the paired-samples t test, we have a sample of difference scores. According to the null hypothesis, there is no difference; that is, the mean difference score is 0. So the mean of the comparison distribution is always 0, as long as the null hypothesis posits no difference.

Therefore, we calculate the difference between the scores, then we basicly consider them our sample to perform a one sample t-test.

The characteristics of the comparison distribution is what values of mean and standard deviation we will use in our test statistic.

##                                     Jobs Boise Los Angeles Difference
## 1                         Executive chef 53047       62490       9443
## 2                     Genetics counselor 49958       58850       8892
## 3                 Grants/proposal writer 41974       49445       7471
## 4                              Librarian 44366       52263       7897
## 5                   Public schoolteacher 40470       47674       7204
## 6 Social worker (with bachelor's degree) 36963       43542       6579

We do not know the standard deviation of the true difference between the samples right? So we have to calculate that as well as the mean for the difference.

The mean is

## [1] 7914

And the standard deviation is:

\[s_\bar{D} = \dfrac{s}{\sqrt{n}}\]

## [1] 438.8

Step 4: Determine the significance level

The exercise already did that for us.

\[\alpha = 0.05\]

Step 5: Calculate Test Statistic

This step is identical to that for the single- sample t test.

\[t = \dfrac{\bar{d} - \mu}{s_{\bar{D}}} = \dfrac{7914.333 - 0}{438.8313}\].

Hence, t statistic is

## [1] 18.04

Step 6.1: Conclude (Statiscal way)

Because this is a two-sided test (alternative hypothesis: not equal), p-value is going to be:

\[P(|T| > 18.03502) = 2P(T>18.03502)\].

pvalue

Moreover, degrees of freedom: N - 1 = 6 - 1 = 5.

Therefore, p-value is:

## [1] 9.628e-06

So, p-value < 0.05. Therefore, we reject the null hypothesis.

Step 6.2: Conclude (English)

There is enough (or significant) evidence to conclude that there is differece between the population mean of income of jobs in Los Angeles than income of jobs in Boise. (It appears that jobs in Los Angeles pay more, on aver- age, than do jobs in Boise.)



Independent T- test

An independent-samples t test is used to compare two means for situation in which each participant is assigned to only one condition.

This test uses a distribution of differences between means.

Example

Who do you think has a better sense of humor-women or men?

Researchers asked 10 men and 10 women in their study to categorize 30 cartoons as eiher “funny” or “funny”. Each participant received a score that represents her or his percentage of cartoons found to be “funny”. Below are fictional data for 9 people; these fictional data have approximately the same means as were reported in the original study (Azim, Mobbs, Jo, Menon and Reiss, 2005).

Percentage of cartoons labeled as “funny”.

Women:84,97,58,90
Men: 88,90,52,97,86

How can we conduct a independent-sample t test for this scenario, using a two-tailed test and a significant level of 0.05.

Step 1: Assumptions

Population 1: Women exposed to humorous cartoons.
Population 2: Men exposed to humorous cartoons.

The comparison distribution will be a distribution of mean differences based on the null hypothesis.

The hypothesis test will be a independent-samples t test because we have two samples composed of differente groups of participants.

Step 2: State the null and alternative hypotheses.

Remember, hypotheses are always about populations, not about our specific samples.

Null hypothesis: On average, women categorize the same percentage of cartoons as “funny” as men. \[H_0: \mu_1 = \mu_2\]

Alternative hypothesis: On average, women categorize a different percentage of cartoons as “funny” as compared with men.

\[H_a: \mu_1 \neq \mu_2\]

Step 3: Determine the characteristics of the comparison distribution

We calculate the standard deviation for men and women separetly. Remeber that the variance for the average of a sample is:

\[s^2_\bar{X} = \dfrac{s^2}{n}\].

For women:

Mean is

## [1] 82.25

And variance:

## [1] 72.4

For men:

Mean is

## [1] 82.6

And variance:

## [1] 61.96

Step 4: Determine the significance level

The exercise already did that for us.

\[\alpha = 0.05\]

Step 5: Calculate Test Statistic

\[t = \dfrac{\bar{x_1} - \bar{x_2} - \mu_1 - \mu_2}{\sqrt{s^2_1 + s^2_2}} = \dfrac{82.25 - 82.6 - 0}{\sqrt{72.39583 + 61.96}}\].

Hence, t statistic is

## [1] -0.0302

Step 6.1: Conclude (Statiscal way)

Because this is a two-sided test (alternative hypothesis: not equal), p-value is going to be:

\[P(|T| > |-0.03019533|) = 2P(T < -0.03019533)\].

pvalue

Moreover, the degrees of freedom are

\[df = (N_1 -1) + (N_2 - 1) = 4 - 1 + 5 -1 = 7\].

Therefore, p-value is:

## [1] 0.9768

So, p-value > 0.05. Therefore, we do not reject the null hypothesis.

Step 6.2: Conclude (English)

There is not enough (or significant) evidence to conclude that there either men or women are more likely than the opposite gender, on average, to find cartoons funny.