0% found this document useful (0 votes)
26 views

t-test-for-means

Uploaded by

Strawberry Cub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

t-test-for-means

Uploaded by

Strawberry Cub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

10.3 T-test for a Single Mean (Ms.

Angelica Mercado and


Mr. Kier Martin Evangelista)

a. Logic of t or z test for mean/s

 Two groups are being compared.


 These can be persons, objects, treatment groups, interventions or a single group to a
population.
 The difference between groups are tested.
 The test is based on group means, either as mean 1 versus mean 2 or as sample
mean versus the population mean.

The purpose of the analysis is to be able to show that the difference between
means is statistically significant.

Q. What is a t-test?

A. A t-test is a statistic that checks if 2 means are significantly different from


each other when the sample sizes are less than 30. (The z-test is used when the
sample sizes are 30 or more.)

Q. Why not just look at the means?

A. Looking at the means may show a difference, but we can’t be sure that the
difference is statistically significant.

Q. How does t-test work?

A. t-test starts with a research problem, followed by data collection, data


processing and finally data analysis.

Assumptions

a. The scale of measurement of the variable/s must be ordinal, interval or ratio


b. The data collected must be a true representative of the population.
c. The data follow a normal distribution.
d. Equal variance exists for two sample tests.

The one sample t- test compares the mean of sample data to a known value for sample
size less than 30.

Formula : t = x - µo
s /√ n

where : t = test statistic

x = mean of the sample

µo = known population mean


s = standard deviation of the sample

n = sample size

1
Examples:

1. It is claimed that a new treatment for prolonging the lives of cancer patients is more
effective than the standard one. Records of earlier research show the mean survival
period to have been 4.3 years with the standard treatment. The new treatment is
administered to a sample of 20 patients, and the durations of their survival are recorded.
The sample mean is 4.6 years and the standard deviation is 1.2 years. Is the claimed
effectiveness of the new method supported at the 1% level of significance?

Step 1. Formulate the appropriate Ho and Ha.

Ho : µ = 4.3 (The new treatment for cancer is as effective as the standard one.)

Ha : µ > 4.3 (The new treatment for cancer is more effective than the standard
one.)

Step 2. Choose the level of significance, α .

α = 0.01

Step 3. Select the appropriate test statistic.

We use the t-test for a single mean since we would like to compare the sample
mean from the population mean and n = 20.

Step 4. Set up a decision rule based on the level of significance.

Reject Ho if the computed value of t < -2.861 or t > 2.861. Otherwise, do not
reject Ho.

Step 5. Collect the data and compute the value of the test statistic from the sample data.

From the problem, the given data are : x = 4.6, µ o = 4.3, s = 1.2, n = 20.
Substitute
these in the formula:

t = x - µo
s /√ n

= 4.6 – 4.3
1.2 / √20
= 1.118
.
Step 6. Use the decision rule to make a decision- either reject Ho or not to reject Ho. State
your conclusion.

The computed value of t is less than the tabular value of 2.861, thus we do not
reject Ho and conclude that there is insufficient evidence to support the claim that the
new treatment is more effective than the standard one.

2. A city health department wishes to determine if the mean bacteria count per unit-volume
of water at Lake C is below the safety level of 200. Researchers have collected 10
water samples and have found the bacteria counts per unit-volume to be 175, 180, 215,
188, 194, 207, 211, 195, 198, and 190. Are the data cause for concern? Use the 0.05
level of significance.

Solution :

2
Step 1. Ho : µo = 200
Ha : µo < 200

Step 2. α = 0.05

Step 3. We use the t-test for a single mean for n = 10.

Step 4. Reject Ho if the computed value of t is - 3.169 (since Ha is left-tailed)

Step 5. Compute the value of t.


We use SPSS to calculate the value of t.

How to use SPSS in computing for the value of t.

a.Encode data in SPSS. The worksheet is shown below.

b. Click ANALYZE, COMPARE MEANS, ONE SAMPLE TEST as shown below

c. The One-Sample T test box will appear on the screen.

3
d. Click the arrow at the middle to transfer the variable (Bacteria) to the vacant
space on right column.

e. Click the space opposite the TEST VALUE and type 200

4
f. Click OPTIONS and check if the confidence interval is 95% (or the level of
significance is 0.05.)

g. Click OK and the output box appears on the screen.

Step 6. In the SPSS output, we cannot find the computed t value but the p-value (the number
under the column title Sig (2-tailed) which is 0.281. Now since the p-value is greater
than 0.05, we do not reject Ho. Evidence is not sufficient to say that the mean
bacteria count per unit-volume of water at Lake C is below the safety level of 200.

10.4 T –test for Two Means (Mr. Kier Martin Evangelista)

- is used when two sample means from correlated or uncorrelated samples are being
compared.

Correlated samples are of two types : those characterized by “before” and “after”
measurements and those where the subjects have been “matched”.

5
The first type of correlated sample is a measurement, followed by an intervention of
some type, followed by another measurement of the same trait. For example, if we wished
to show the effectiveness of a diet program in terms of weight loss, we would weigh the
subjects first, then have them follow the diet for a period, and finally weigh them again.
The data used in the test would then be differences between weights before the diet and their
weights after the diet.

The second type of dependent sample occurs when the researcher “pairs” subjects in
an attempt to eliminate or control for the effects of other variables. For example, we wished
to compare the intelligence of men and women, we might select married couples and
administer an intelligence test to both the husband and the wife. In this way, we would hope
to eliminate other effects, such as age, race, or socio-economic status, and measure only the
difference in intelligence between men and women.

T-test for uncorrelated samples is used when two separate sets of uncorrelated
samples are obtained, one from each of the two populations being compared. For example,
a test is being designed to compare the wearing quality of 2 brands of automobile tires. A
sample of cars will be selected at random and equipped with brand A and driven for one
month. Another sample of cars will be selected and equipped with brand B and driven for
one month. Measurements will be taken separately for the two samples to determine how
much wear took place.

10.4.1 Application of the T-test for correlated samples

Assumptions

a. Two dependent samples must be selected from two populations in a way that is
random.
b. Each of the two populations must be normally distributed.

Formula:
tc= d – Do__
sd / √/n
where :
tc - computed t statistic
Do – is the hypothesized difference in the population
sd – is the standard deviation of the di s
n – number of paired observations

Problem No.1

A local school system wants to investigate the effect of kindergarten experience on the
performance of first grade female pupils. Sixteen pairs of first grade female pupils were
obtained with members of each pair having almost similar psychological test scores, family
socio-economic status, general health, and family size. One member of the pair attended
kindergarten a year prior to first grade while the other member never attended the pre-school.
Halfway through the year of the first grade, the 16 girls were tested for mastery of the first
grade material taught, and had the ff scores:

Pair 1 2 3 4 5 6 7 8

W/ kindergarten 83 74 67 64 70 67 81 64

W/o kindergarten 73 74 63 66 68 63 77 65

6
Test at α =0.05

Solution:
Step 1. Formulate Ho and Ha.
Ho : µK = µNK (There is no significant difference between the performance
of first grade female pupils with or without kindergarten
experience.)
Ha : µK > µNK (The performance of first grade female pupils with kindergarten
experience is better than those without kindergarten
experience.)
Step 2. Determine the value of α.
α =0.05
Step 3. Choose the appropriate test statistic.
T-test for correlated samples will be used because the 2 samples were paired or
matched.
Step 4. State the decision rule.
Reject Ho if the computed absolute value of t is equal to or greater than the
critical value of t at α =0.05 and df = n-1 = 8-1 = 7
Step 5. Collect the data and compute the value of the t test.

Method A - Manual computation


a.1 Rewrite the data and calculate the difference (di) of each pair of values; then get
the sum, ∑di divide it by n to obtain the average difference, d.

Pair W/ W/o di
kindergarten kindergarten
1 83 73 10
2 74 74 0
3 67 63 4
4 64 66 -2
5 70 68 2
6 67 63 4
7 81 77 4
8 64 65 -1
∑ di = 21
d = 21/8
= 2.625
a.2 Get the difference of each di from d; square each difference. Obtain the total.
Bureau W/ W/o di (di - d) 2
kindergarten kindergarten di -d
1 83 73 10 7.375 54.39063

2 74 74 0 -2.625 6.890625

3 67 63 4 1.375 1.890625

4 64 66 -2 -4.625 21.39063

5 70 68 2 -0.625 0.390625

6 67 63 4 1.375 1.890625

7
7 81 77 4 1.375 1.890625

8 64 65 -1 -3.625 13.14063

∑(di -d) 2=101.875


a.3 Obtain the value of the standard deviation of the di s, s d
sd = √ ∑(di-d) 2 /n-1
= √ 101.875/8-1
= √ 101.875/7
= √ 14.55357
= 3.815
a.4 Use the formula
tc= d – Do__
sd / √/n
where :
tc - computed t statistic
Do – is the hypothesized difference in the population
sd – is the standard deviation of the di s
n – number of paired observations

Now substituting the values,

tc = 2.625 – 0____
3.814914/√8
= ____2.625__________
3.814914/(2.828427)

= ____2.625______
1.348776

= 1.946209

Method B - Using MS Excel


Procedure
1. Open MS Excel. Encode the data values in 2 columns.
2. Highlight the data values in the two columns.
3. On the menu bar, click DATA, DATA ANALYSIS. From the dialog box,
choose, t- test: paired two sample for means.
4. Enter the range of the data values for the 1st column. Do the same for the
data values in the 2nd column. Click ok. The result is shown below.

t-Test: Paired Two Sample for Means

Variable 1 Variable 2
Mean 71.25 68.625
Variance 54.78571429 28.83928571
Observations 8 8
Pearson Correlation 0.868845445
Hypothesized Mean Difference 0
Df 7
t Stat 1.946209151
8
P(T<=t) one-tail 0.046341805
t Critical one-tail 1.894578604
P(T<=t) two-tail 0.09268361
t Critical two-tail 2.364624251

Before we go to step 6, let us analyze the MS Excel output.


 Variable 1 refers to the w/ kindergarten and variable 2 denotes w/o kindergarten
 The means of the two variables are 71.25 and 68.625 respectively.
 The variances are 54.79 and 28.84, respectively.
 The number of observations of each variable is 8.
 The hypothesized mean difference, Do is 0.
 Df stands for degrees of freedom, which is equal to n-1, .i.e. 7 in this case.
 t Stat is the computed value of the t-statistic which is 1.946209151.
 P(T<=t) one-tail = 0.046341805 is the p-value of the t-statistic for a one-tailed test.
 t Critical one-tail = 1.894578604 is the tabular value of the t-statistic for a one-tailed
test.
 P(T<=t) two tail = 0.09268361 is the p-value of the t-statistic for a two-tailed test.
 t Critical two tail = 2.364624251 is the tabular value of the t-statistic for a two-tailed
test.

In analyzing the test results generated through MS Excel, focus only on these three
values : computed t –value (or t-Stat), critical value of t (or t- Critical), and the p-value of
the t-test (or P(T< =t).

Method C - Using SPSS


Procedure
1. Open SPSS. Encode the data values in 2 columns.
2. Click ANALYZE, COMPARE MEANS, PAIRED SAMPLES T-TEST…
3. The result is as follows:

Paired Samples Statistics

Mean N Std. Deviation Std. Error Mean

Pair 1 Withkindergarten 71.25 8 7.402 2.617

Nokindergarten 68.63 8 5.370 1.899

Paired Samples Test

Paired Differences

Std. Std. Error 95% Confidence Interval of the Difference Sig. (2-
Mean Deviation Mean Lower Upper t df tailed)

Pair 1 Withkindergarten -
2.625 3.815 1.349 -.564 5.814 1.946 7 .093
Nokindergarten

Now, let’s continue with our solution in step 6 either by


- comparing the computed t-value with the tabular t-value; or
- comparing the p-value with 0.05.

Step 6. Make a decision


9
Method A (manual computation) : Compare the critical value with the tabular value

Since the computed t-value = 1.946 is higher than the tabular (or critical) value
of t = 1.895 for a one-tailed test, we reject Ho.

Method B (using MS Excel) : Compare the p -value of the test with the pre- determined
alpha. The p-value = 0.046 is less than 0.05, we reject Ho.

Method C – (using SPSS) : There is no option for a one-tailed test in SPSS. We’ll just
compare the computed value of t (1.946) with its tabular value at 0.05 level of
significance which is 1.895. We reject Ho.

State the conclusion

All the 3 methods of computation show that Ho is rejected. Thus, there is sufficient
evidence to conclude that first grade female pupils with kindergarten experience
performed better than those without kindergarten experience.

Problem No. 2
In the research study on the degree of seriousness of problems encountered by college
freshmen, data were taken before and after their individual counseling sessions. From the 15-
item problem checklist, the corresponding degree of seriousness of problems encountered by the
students before and after their individual sessions comprise the data to be compared.

Student 1 2 3 4 5 6 7 8 9 10

Before attending a counseling 3 3.25 3 2.5 2.75 2.5 2.75 3.75 3.5 3.6
session

After attending a counseling 4 3.5 3.5 3.6 3.45 2.75 4.75 4 3.51 4.5
session

Determine if there exists a significant difference in the degree of seriousness of problems


encountered by the college freshmen before and after the counseling sessions.

Solution:

Step 1. Ho : µB = µA (There is no significant difference in the mean degree of seriousness of


problems encountered by college freshmen before and after the
individual counseling sessions.)

Ha : µB ≠ µA (There is a significant difference in the mean degree of seriousness of


problems encountered by college freshmen before and after the
individual counseling sessions.)
Step 2. α = 0.05.
Step 3. Use the t- test for correlated samples.
Step 4. Decision Rule: Reject Ho if the computed t- statistic is greater than or equal to the
critical t-value of 2.262 or t is less than or equal to -2.262
Step 5. Computations

i) First, rewrite the data and get the difference between the two values, i.e.
Student Before After di
1 3 4 (3-4) = -1
2 3.25 3.5 (3.25-3.5) = -0.25
3 3 3.5 -0.5
10
4 2.5 3.6 -1.1
5 2.75 3.45 -0.7
6 2.5 2.75 -0.25
7 2.75 4.75 -2
8 3.75 4 -0.25
9 3.5 3.51 -0.01
10 3.6 4.5 -0.9

ii) Next, square each of the di’s, then get the total of the di and di 2 i.e.

Student Before After di di 2


1 3 4 -1 1
2 3.25 3.5 -0.25 0.0625
3 3 3.5 -0.5 0.25
4 2.5 3.6 -1.1 1.21
5 2.75 3.45 -0.7 0.49
6 2.5 2.75 -0.25 0.0625
7 2.75 4.75 -2 4
8 3.75 4 -0.25 0.0625
9 3.5 3.51 -0.01 -0.0001
10 3.6 4.5 -0.9 0.81
Totals>
> ∑di= -6.96 ∑di 2 = 7.9474

iii) Use the formula t= ∑di__________


n ∑di 2 - (∑di) 2
n-1
where t = t - statistic
∑di = sum of the differences between the paired values
∑di 2 = sum of the squared differences between the paired values
n = number of paired observations

t= - 6.96___________
10 (7.9474) – (-6.96)2
10 - 1

t = -- 3.74

Decision : Since the absolute value of the computed t = / - 3.74/ is greater than the critical
value of t = 2.262, w/ 9 degrees of freedom, Ho is rejected.

Conclusion : There is a significant difference in the degree of seriousness of problems


encountered by college freshmen before and after the individual counseling sessions. The data
set provides sufficient evidence that the counseling session was effective in decreasing the
degree of seriousness of the problems experienced by college freshmen.

How to use the MS Excel to generate the output for t-test

1. Go to MS Excel.
2. Type the data in two columns, A and B.
3. On the menu bar above, click DATA, DATA ANALYSIS
4. From the DATA ANALYSIS dialogue box, choose t-test : Paired two samples for
Means.
5. On the space provided, input the range of data for variable 1.
6. Input the range of data for variable 2.
7. Click OK. The result is as follows.

t-Test: Paired Two Sample for Means


11
Variable 1 Variable 2
Mean 3.06 3.756
Variance 0.202666667 0.33136
Observations 10 10
Pearson Correlation 0.365047966
Hypothesized Mean
Difference 0
Df 9
t Stat -3.748079703
P(T<=t) one-tail 0.002284094
t Critical one-tail 1.833112923
P(T<=t) two-tail 0.004568188
t Critical two-tail 2.262157158

Remarks about the print out :

1. The computed value of t is -3.748079703. Since the test is two-tailed, the critical value is
-2.262.
2. Note that the manual computation is the same as the MS Excel output.
3. P (T< = t) two-tail = 0.004568188 is the p-value of the test. Recall that this can be another
basis for your decision to reject or accept Ho.

If the p-value is less than the pre-determined level of significance, Ho is rejected. In


this case, the predetermined value of α = 0.05 for one tailed and 0.025 for two-tailed.
Since the p-value = 0.00457 is less than 0.025, Ho is rejected.

10.4.2 Application of T-test for uncorrelated (or independent samples)

Sample questions regarding uncorrelated variables in real –life :

a. Do male and female students differ in their level of math anxiety?


b. Do older people exercise significantly less frequently than younger people?

Give additional examples.

Uncorrelated or independent samples means that :

 Subjects in the first group cannot also be in the second group


 No subject in either group can influence subjects in the other group
 No group can influence the other group

Assumptions
a. Two independent / uncorrelated small samples must be selected from two populations
in a way that is random.
b. Each of the two populations must be approximately normally distributed.
c. The variances are unknown but equal.
Formula:

12
t =________x 1 – x 2_________________
SS1 + SS2 1 +1
n1 + n2 - 2 n1 n2

with degrees of freedom = n1 + n2 - 2

where

x 1 is the mean of the first sample.


x 2 is the mean of the second sample.
n1 is the sample size of the first group.
n2 is the sample size of the second group.
SS1 is sum of squares of the first group
SS2 is the sum of squares of the second group

Formula for SS1 >>>


SS1 = ∑x12 - (∑x1) 2
n1
Formula for SS2 >>>
SS2 = ∑x2 - (∑x2) 2
2

n2
Problem No. 1

The following are the scores of 10 male and female AB students in Spelling. Test the
hypothesis that there is no significant difference between the performance of male and female
students in the said test. Use alpha = 0.05.

Male 14 18 17 16 4 14 12 10 9 17

Femal 12 9 11 5 10 3 7 2 6 13
e

Solution: The two samples are uncorrelated..


Let μM be the average score in spelling of the male AB students
μF be the average score in spelling of the female AB students

Step 1. State Ho and Ha.


Ho : There is no significant difference in the performance in spelling of male
and female AB students. Symbolically, μM = μF
Ha : There is a significant difference in the performance in spelling of male
and female AB students. Symbolically, μM ≠ μF.

Step 2. The level of significance, α = 0.05.


Step 3. The appropriate test statistic is t (for uncorrelated samples.)
Step 4. Decision Rule : Reject Ho if the absolute value of the computed t > 2.101
Step 5. Computations :

Using manual computation


x for males = 13.1 ; x for females = 7.8
SSM = 174.9 SSF = 129.6
nM = 10 nF = 10

Substitute the values in the formula,

13
t =___x M – x F_______________________
SSM + SSF 1 +1
nM + nF - 2 nM nF
with degrees of freedom = nM + nF - 2

t =___ 13.1 – 7.8_______________


174.9 + 129.6 1 +1
10 + 10 - 2 10 10

t =___ 5.3_______
304.5 2
18 10

t =__5.3___
609
180

t =__5.3___
3.38333

t =__5.3___
1.83938

t = 2.8814

Decision : Since the computed t = 2.8814 is greater than the tabulated t value =
2.101, Ho is rejected.

Conclusion : There is a significant difference in the performance in spelling of


male and female AB students. Data showed that males performed better in spelling
than females.

Using MS Excel

To generate the print out for t-test from MS Excel , follow the same procedure,
but this time, click t- test: two sample assuming equal variances, instead of t-test :
Paired two samples for Means..

The result is as follows:

t-Test: Two-Sample Assuming Equal Variances

Variable Variable
1 2
Mean 13.1 7.8
Variance 19.43333 14.4
Observations 10 10
Pooled Variance 16.91667
Hypothesized Mean 0
14
Difference
Df 18
t Stat 2.881399
P(T<=t) one-tail 0.004968
t Critical one-tail 1.734064
P(T<=t) two-tail 0.009936
t Critical two-tail 2.100922

The computed t is 2.8814 and the critical or tabular value is 2.101, thus we reject Ho.
Moreover, since the p-value for 2-tailed test = 0.0099 is less than the pre-determined
level of significance, α = 0.025 (2-tailed test), Ho is rejected.

Using SPSS

a. Encode the data.

15
b. Click ANALYZE, COMPARE MEANS, INDEPENDENT SAMPLES T-TEST.

c. Click OK and the result is shown below.

Group Statistics

Sex N Mean Std. Deviation Std. Error Mean

Spelling Male 10 13.1000 4.40833 1.39403

Female 10 7.8000 3.79473 1.20000

16
Independent Samples Test

Levene's Test for

Equality of

Variances t-test for Equality of Means

95% Confidence

Interval of the

Sig. (2- Mean Std. Error Difference

F Sig. t df tailed) Difference Difference Lower Upper

Spelling Equal variances assumed .087 .771 2.881 18 .010 5.30000 1.83938 1.43560 9.16440

Equal variances not


2.881 17.610 .010 5.30000 1.83938 1.42946 9.17054
assumed

The p-value in the SPSS output is 0.010 (in MS Excel the p-value is 0.009936). The
decision is also reject Ho.

Give a second problem and perform a hypothesis test. Illustrate how to compute the t
value.

17

You might also like