7-Applying The T-Test For Independent and Dependent Samples-13
7-Applying The T-Test For Independent and Dependent Samples-13
# paired t-test
We can use the var.equal = TRUE option to specify equal and a pooled variance
estimate, use the alternative="less" or alternative="greater" option to specify a one
tailed test.
Comparing the sample mean with a known value, when population variance is not
known.
Problem 1 :-
Sol:
Inference:-
From the output we see that the p-value = 0.029. Hence, there is moderately
strong evidence that the mean Salmonella level in the ice cream is above 0.3
MPN/g.
Problem 2: Suppose that 10 volunteers have taken an intelligence test; here are the
results obtained. The average score of the entire population is 75 in the same test. Is
there any significant difference (with a significance level of 95%) between the sample
and population means, assuming that the variance of the population is not known.
Scores: 65, 78, 88, 55, 48, 95, 66, 57, 79, 81
> qt(0.975, 9)
[1] 2.262157
Inference:-
t.test usage:
Problem 3: Comparing two independent sample means, taken from two populations
with unknown variance.The following data shows the heights of individuals of two
different countries with unknown population variances. Is there any significant
difference b/n the average heights of two groups.
A: 175 168 168 190 156 181 182 175 174 179
B: 185 169 173 173 188 186 175 174 179 180
Solution:-
Inference :-
The p-value > 0.05, we conclude that the means of the two groups are
significantly similar
The value of t is less than the tabulated t-value for 10,224 df, we accept H0.
Problem 4: Suppose the recovery time for patients taking a new drug is measured (in
days). A placebo group is also used to avoid the placebo effect. The data are as
follows
with drug : 15 10 13 7 9 8 21 9 14 8
placebo : 15 14 12 8 14 7 16 10 15 2
Is there any significant difference between the average effect of these two drugs?
Solution:-
Inference :-
P value(0.3002) > 0.05 then there is no evidence to reject our Null hypothesis.
Problem 5: Six subjects were given a drug (trearment group) and an additional 6
subjects a placebo(control group).Their reaction time to stimulus was
measured(in ms).We want to perform a two sample t-test for comparing the
means of the treatment and control groups.
Control 91 87 99 77 88 91
Treatment 101 110 103 93 99 104
Rcode:-
Inference:-
From both the output we see that the p-value = 0.003136(equal) and
0.003391(Unequal). Therefore, it infers that there is different between treatment
and control group.
Practice Problems :-
1. A certain stimulus administered to each of the 13 patients resulted in the following increase of
blood pressure: 5, 2, 8,-1, 3, 0, -2, 1, 5, 0, 4, 6, 8. Can it be concluded that the stimulus, in
general, be accompanied by an increase in the blood pressure?
2. The manufacturer of a certain make of electric bulbs claims that his bulbs have a
mean life of 25 months with a standard deviation of 5 months. Random samples of 6
such bulbs have the following values: Life of bulbs in months: 24, 20, 30, 20, 20, and
18. Can you regard the producer’s claim to valid at 1% level of significance?
3. the life time of electric bulbs for a random sample of 10 from a large consignment
gave the following data: 4.2, 4.6, 3.9, 4.1, 5.2, 3.8, 3.9, 4.3, 4.4, 5.6 (in ‘000 hours).
Can we accept the hypothesis that the average life time of bulbs is 4, 000 hours
4. Data on weight (grams) of two treatments of NMU ( nistroso- methyl urea) are
recorded. Find out whether these two treatments have identical effects by using t test
for sample means at 5% level of significance.
Sample 1 2 3 4 5 6 7 8 9 10 11 12
Treatments 0.2 % 2.0 2.7 2.9 1.9 2.1 2.6 2.7 2.9 3.0 2.6 2.6 2.7
0.4% 3.2 3.6 3.7 3.5 2.9 2.6 2.5 2.7
No 237 289 257 228 303 275 262 304 244 233
Drug(x1)
Drug(x2) 194 240 230 186 265 222 242 281 240 212