0% found this document useful (0 votes)
369 views22 pages

Fem3004 Practical 7 Ttest Large Sample

1. The document discusses four statistical tests performed on different datasets: - A t-test to compare the mean price of school uniforms to a claim. The data does not support the claim. - A test of independence to see if gender and seatbelt use are related. The test finds they are independent. - A t-test comparing heart rates of smokers and non-smokers. The means are found to be different. - A t-test to compare satisfaction scores between families with and without a neighborhood playground. The means are found to be different. 2. Questions at the end ask to perform the final test manually and using SPSS to determine if mean satisfaction scores differ between families with and

Uploaded by

Shar Khan
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)
369 views22 pages

Fem3004 Practical 7 Ttest Large Sample

1. The document discusses four statistical tests performed on different datasets: - A t-test to compare the mean price of school uniforms to a claim. The data does not support the claim. - A test of independence to see if gender and seatbelt use are related. The test finds they are independent. - A t-test comparing heart rates of smokers and non-smokers. The means are found to be different. - A t-test to compare satisfaction scores between families with and without a neighborhood playground. The means are found to be different. 2. Questions at the end ask to perform the final test manually and using SPSS to determine if mean satisfaction scores differ between families with and

Uploaded by

Shar Khan
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/ 22

UNIVERSITI PUTRA MALAYSIA

FEM3004 STATISTIK SAINS SOSIAL


(SOCIAL SCIENCE STATISTIC)
SEMESTER 2 SESI 2021/2022
PRACTICAL 7
t-TEST

1. The mean price of all school uniform was RM 72 last year. A recent sample of
65 school uniforms produced a mean price equals to RM 75.22 with a
variance of 16. One of college lecturers claims that the current mean price of
all school uniform is greater than RM 81.Assume that the prices of all school
uniforms have a normal distribution. The significance level is 1%.
μ=7 2
n=6 5
x=75.22
2
s =16
∝=1 %=0.01

a. State the null and alternative hypotheses.


H̥ : μ=81
one-tailed (upper tail / +ve side)

H̥ : μ> 81

b. Obtain the critical value.


Significant level = 0.01 → in graph = +2.33
0.01

Critical valie, z = 2.326


z = 2.33
c. Determine the value of the test statistics.
Single mean formula :-
x−H̥
z= x=75.22
s/√n
H̥ : μ=81

75.22−81 s=√ 16=4


z=
4 /√ 65 n=6 5

z = -11.65

d. Does the data provide sufficient evidence to support the claim?


Since the test statistics does not fall under the rejection region, so we fail
to reject H̥ . Thus, the current mean price of all school uniform is lower
than RM81. The data does not provide sufficient evidence to support the
claim.

2. One hundred auto drivers were stopped by the police to see if they were
wearing seat belts. Records of the results were given in the following table.
Wearing seat belt Not wearing seat
belt
Men 64 41
Women 52 33
Test at the 2.5% significance level whether gender wearing seat belt are
independent.

H̥ : p ₁− p ₂=0
H̥ : p ₁= p ₂

H ∝ : p ₁− p ₂≠ 0
two-tailed (both tails / +ve and -ve sides)
H ∝ : p ₁≠ p ₂
Significant level = 2.5% = 0.025 → in graph = ± 2.24

-3.06 -2.24 +2.24

Test statistics for two propotions:

^p ₁−^ p ₂−0
z=
√ ^p q^[ 1 1
+
n₁ n₂ ]
41
^
p ₁= = 0.64
64

33
^
p ₂= = 0.92
36

n₁ = 64
n₂ = 36

41+33
^p = = 0.74
100

q^ = 1 – 0.74 = 0.26

0.64−0.92−0
z=
√ (0.74)(0.26) [
1 1
+
64 36 ]
z = -3.06
As a conclusion, since the test statistics fall under the rejection region, so we
reject H̥ . This mean H ∝ is true. Thus, gender wearing seat belt are
independent.
3. A researcher wishes to see whether the mean of the heart rates (in beats per
minutes) of smokers are different from the means of heart rates of people
who do not smoke. The two samples are selected and the data are shown
below. Using alfa = 0.05, is there enough evidence to support the claim?
Smoker Non-smoker
n 60 60
Mean 72 86
s 3.20 3.18

H̥ : µ ₁=µ₂
two-tailed (both tails / +ve and -ve sides)
H ∝ : µ₁ ≠ µ ₂

Significant level = 0.05 → in graph = ± 1.96

x ₁=72
x ₂=86
s ₁=3.20
s ₂=3. 18

-24.04 -1.96 +1.96 n ₁=6 0


n ₂=60
Test statistical for two means:-

x^₁−^x ₂−0

√ [
z = (s ₁)² (s ₂)²
n₁
+
n₂ ]
72−86−0

√ [
z = (3.20) ² (3.18)²
60
+
60 ]
z = -24.04

For a conclusion, since the test statistics fall under the rejection region, so we
reject H̥ . This mean H ∝ is true. Thus, the mean of the heart rates (in beats
per minute) of smokers are different from the mean of heart rates who do not
smoke.

4. By referring to the following data set that has been used in earlier practical
classes, answer the questions given after the data set.
The following data are from Parks visitors. Here are the meanings of each
variable
 Family is the observation number of the questionnaire. One
questionnaire was filled by for one family, not for individual.
 Time is a quantitative data type, measured in minutes. It is the activity
time of the family in the park.
 Mode is a nominal data type consist of four choice of mode to go to
park:
1 walk, 2 car, 3 cycling, 4 bus
The choice is mutually exclusive, that is only one mode for one family.
 Activity is a nominal data type consist of 6 choices of activity in the
park:
1 sport, 2 picnic, 3 reading, 4 walk (including with the dog), 5
meditation, 6 jog
The choices are multiple choices, that one family may have several
activities in the park.
 Satisfaction is an ordinal scale with 5 values:
o -2 = Very dissatisfied
o - 1 = dissatisfied
o 0 = indifference
o 1 = satisfied
o 2 = Very satisfied
It measures family satisfaction toward the park's services.
 Playground is a nominal scale (Yes or No) about the existence of
children playground

  The data is shown in this table.


Family Time Mode Activity Satisfaction Satisfaction Satisfaction Playground
with with with
playground playground playground
facilities size environment

1 30 1 1, 2, 3 0 2 0 N

2 30 3 4,6 1 1 1 Y

3 60 2 1, 2 2 2 2 Y

4 45 1 5 -2 -1 -1 N

5 30 1 6 1 -1 1 N

6 60 2 2 1 2 2 Y

7 30 3 4 1 0 1 N

8 45 2 3, 4 2 -1 -1 N

9 15 1 6 1 2 1 Y

10 60 2 2 2 2 2 Y

11 180 4 1, 2, 3, 4 2 1 2 Y
12 120 2 1,2,4 2 -1 2 Y

Answer the following questions using two methods: using SPSS and doing manually
(without SPSS - use the values that you need to do the manual calculation from the
SPSS). (The satisfaction score must be totaled for the three aspects of satisfaction).

Determine whether the mean satisfaction score in using the playground is different for
families that have playground in their neighbourhood and those that don’t have
playground. Assume that the data have a normal distribution and the significance level
is 1%.
Manually

H̥ : µ ₁=µ₂
two-tailed
H ∝ : µ₁ ≠ µ ₂

Significant level = 1% = 0.01, no direction stated (two-tailed)



= 0.005
2

x^₁−^x ₂−0

√ [
z = (s ₁)² (s ₂)²
n₁
+
n₂ ]
0.2−4.57−0

√ [
z = (2.265) ² (1.192)²
30
+
42 ]
z = -9.658


= 0.005
2
p(z) = ± 2.57

-2.57 +2.57

z-value fall into rejection area, reject H̥ at 1% significance level. There are different
between satisfaction score in using the playground for families that have playground in
their neighbourhood and those don’t have playground.

SPSS
(a) State the null and alternative hypotheses.
H̥ : There is no significance difference between mean satisfaction score in
using the playground for family that have playground in their neighbourhood
and those that don't have playground.
H ∝ : There is significance difference for families that have background in their
neighbourhood and those that don't have playground for mean satisfaction
score.
(b) Obtain the critical value.

Significant level = 1% = 0.01, no direction stated (two-tailed)



= 0.005
2

x^₁−^x ₂−0

√ [
z = (s ₁)² (s ₂)²
n₁
+
n₂ ]
0.2−4.57−0

√ [
z = (2.265) ² (1.192)²
30
+
42 ]
z = -9.658

(c) Determine the value of the test statistics.


= 0.005
2
p(z) = ± 2.57
-2.57 +2.57

(d) Does the data provide sufficient evidence that there is a different in
satisfaction?
z-value fall into rejection area, reject H̥ at 1% significance level. There are
different between satisfaction score in using the playground for families that
have playground in their neighbourhood and those don’t have playground.
Data Coding from Questionnaires. Copy and paste the data 6 times resulting in 72
data sets.
Activity Satisfaction
1 2 3 4 5 6 Satisfaction Satisfaction Satisfaction Playground
Fa Ti Mo
with with with
mil m de playground playground playground
facilities size environmen
y e t

1 30 1 1 1 1 0 0 0 0 2 0 0

2 30 3 0 0 0 1 0 1 1 1 1 1
3 60 2 1 1 0 0 0 0 2 2 2 1
4 45 1 0 0 0 0 1 0 -2 -1 -1 0
5 30 1 0 0 0 0 0 1 1 -1 1 0
6 60 2 0 1 0 0 0 0 1 2 2 1
7 30 3 0 0 0 1 0 0 1 0 1 0
8 45 2 0 0 1 1 0 0 2 -1 -1 0
9 15 1 0 0 0 0 0 1 1 2 1 1
10 60 2 0 1 0 0 0 0 2 2 2 1
11 180 4 1 1 1 1 0 0 2 1 2 1
12 120 2 1 1 0 1 0 0 2 -1 2 1
ANOVA ANALYSIS

5. The following data contain three scores from each of five subjects. The three
scores per subject are their scores on three trials of a memory task.

Subject Score trial 1 Score trial 2 Score trial 3


A 4 6 7
B 3 7 7
C 2 8 5
D 1 4 7
E 4 6 9

a. Compute an ANOVA.

T₁ = 14
T₂ = 31
T 3 = 35

G = 14 + 31 + 35
= 80

G2
CM =
n
802
=
15
= 426.67

ƩTi
SST = – CM
ni

= [ 14 2 312 352
5
+
5
+
5 ]
−426.67

= 476.4 – 426.67
= 49.73

Total SS = Ʃ x i j ² - CM
= (4² + 3² + 2² + 1² + 4² + 6² + 7² + 8² + 4² + 6² + 7² + 7² + 5² + 7²
+ 9²) - 426.67
= 500 - 426.67
= 73.33

SSE = Total SS – SST


= 73.33 – 49.73
= 23.6

Sources df SS MS F
Treatmen 2 49.73 24.87 12.62
t
Error 12 23.6 1.97
Total 14 73.33

H̥ : µ ₁=µ₂=μ 3
H ₁ = at least one mean is different
T E
∝ = 0.01 , df = (2,12)
F critical / ∝ = 6.93

MST
Test statistic = F =
MSE
24.87
=
1.97
= 12.62

∴ there is a difference in 3 trial score.


b. Test all pairwise differences between means using the Tukey test at
the .01 level.
√ MSE
s
w = q ∝ (k , df) ( )
√ ni

ST₁ ST₂ ST 3
Total 14 31 35
Mean 2.8 6.2 7

= q 0.01 (3 , 12)
1.40
= 5.05 ( )
√5
= 3.16
Compare mean differences
x ₂−x ₁ = 6.2 – 2.8 = 3.4 ¿ 3.16
x ₃−x ₁ = 7 – 2.8 = 4.2 ¿ 3.16
x ₃−x ₂ = 7 – 6.2 = 0.8 ¿ 3.16

∴ the majority mean differences are more than omega, so the null hypothesis is
rejected.

6. Students were treated with different drug before revising for their exams.
Some were given a memory drug, some a placebo drug and some no
treatment. The exam scores (%) are shown below for the three groups.

Memory drug Placebo No treatment


70 37 3
77 43 10
83 50 17
90 57 23
97 63 30
Mean 83.4 50.0 16.6
Variance 112.3 109.0 112.3
Grand mean 50.0
Grand variance 892.14
a. Perform a one-way ANOVA by hand to test the hypothesis that the treatments
will have different effects.

T₁ = 417
T₂ = 250
T 3 = 83

G = 750

2
G
CM =
n
7502
=
15
= 37,500

Ʃ T i²
SST = – CM
ni

( )
2 2 2
417 250 83
= + + −37,500
5 5 5
= (34,777.8 + 12,500 + 1,377.8) – 37,500
= 11,155.6

Total SS = Ʃ x i j ² - CM

Memory drug = (70² + 77² + 83² + 90² + 97²) = 35,227


Placebo = (37² + 43² + 50² + 57² + 63²) = 12,936
No treatment = (3² + 10² + 17² + 23² + 30²) = 1,827

Total SS = (35,227 + 12,936 + 1,827) – 37,500


= 49,990 – 37,500
= 12,490

SSE = Total SS – SST


= 12,490 – 11,155.6
= 1,334.5

Sources df SS MS F

Treatment 2 11,155.6 5,577.8 50.16


Error 12 1,334.4 111.2
Total 14 12,490

H̥ : µ ₁=µ₂=μ 3
H ₁ = at least one mean is different

∝ = 0.01 , df = (2,12)
F critical / ∝ = 3.89
MST
Test statistic = F =
MSE
5,577.8
=
11 1.2
= 50.16

∴ the null hypothesis is rejected because the test statistic is greater than
alpha.

∴ there is a difference in the three final score.

b. Do the pairwise comparisons using Tukey method.


√ MSE
s
w = q ∝ (k , df) ( )
√ ni

Memory drug Placebo No treatment


Total 417 250 83
Mean 417 250 83
= 83.4 = 50 = 16.6
5 5 5

q ∝ (k , n-k)
q 0.05 (3,12)
= 3.77

w = 3.77 ( 10.55
√5 )
= 17.79

S = √ MSE
= √ 111.2
= 10.55
Compare mean differences
x ₁−x ₂ = 83.4 – 50 = 33.4 ¿ 17.79
x ₁−x ₃ = 83.4 – 16.6 = 66.8 ¿ 17.79
x ₂−x ₃ = 50 – 16.6 = 33.4 ¿ 17.79

w = 17.79

∴ all of the mean differences are more than w = 17.79. So, the null
hypothesis is rejected
∴ the majority mean differences are more than omega, so the null hypothesis,
Hₒ is rejected.

7. A scientist was interested in how monkeys learn to perform a task. The task was
to retrieve a coconut from the opposite side of a river. 15 wild monkeys were
assigned to one of three conditions: observing a monkey (they watched another
monkey retrieve the coconut by building across the stream), observing a human
(they watched a human solve the task), banana reward (they were allowed to do
what they wanted but every time they engaged in behavior that facilitated solving
the task they were rewarded with a banana. After learning the monkeys were
required to solve the problem again and the time taken to solve the problem was
measured.
Memory drug Placebo No treatment
1 7 15
1 15 8
7 1 13
13 8 13
13 9 6
Mean 7.0 8.0 11.0
Variance 36.0 25.0 14.5
Grand mean 8.67
Grand variance 24.67

a. Perform a one-way ANOVA by hand to test the hypothesis that the treatments
will have different effects.

T₁ = 35
T₂ = 40
T 3 = 55
G = 130
N = 15
k=3

H̥ : µ ₁=µ₂=μ 3
H a = at least one mean is different

G2
CM =
n
13 02
=
15
= 1,126.7
Ʃ T i²
SST = – CM
ni

= ( 352 4 02 552
5
+
5
+
5 )−1, 126.7

= (245 + 320 + 605) – 1,126.7


= 1,170 – 1,126.7
= 43.3

Total SS = Ʃ x i j ² - CM

Memory drug = (1² + 1² + 7² + 13² + 13²) = 389


Placebo = (7² + 15² + 1² + 8² + 9²) = 420
No treatment = (15² + 8² + 13² + 13² + 6²) = 663

Total SS = (389 + 420 + 663) – 1,126.7


= 1,472 – 1,126.7
= 345.3

SSE = Total SS – SST


= 345.3 – 43.3
= 302

Sources df SS MS F

Treatment 2 43.3 21.65


Error 12 302 25.17
Total 14 345.3

df = k – 1
=3–1
=2

df = N – k
= 15 – 3
= 12

df = (2,12)

∝ = 0.05 , df = (2,12)
F critical / ∝ = 3.89 (refer to table F critical value)

MST
F=
MSE
21.65
=
25 .17
= 0.86

∴ the Hₒ, null hypothesis is rejected because the test statistic is greater
than ∝ = 0.05.

∴ there is difference in the three total score.

b. Do the pairwise comparisons using Tukey method.

q ∝ (k , dfw)
( √ MSW
√ no subt )
(3,12) ((
√5 )
q 0.05 √ 25.095

= (3.77) (2.2403)
= 8.45
Pair - wise differences
x ₁−x ₂ = 7.0 – 8.0 = 1 (does not reject)
x ₁−x ₃ = 7.0 – 11.0 = 4 (does not reject )
x ₂−x ₃ = 8.0 – 11.0 = 3 (does not reject)

∴ we failed to reject Hₒ because all of the pair-wise difference are smaller than
Turkey value.

∴ As a conclusion, since both a) and b) failed to reject Hₒ, then it is true that we
failed to reject Hₒ .

You might also like