Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
16 views38 pages

T Test

This document provides an overview of hypothesis testing, focusing on the Student's T-test as a method for comparing means between groups. It explains the concepts of null and alternative hypotheses, the significance level, and factors affecting confidence intervals. Additionally, it details the types of T-tests, including one-sample, independent two-sample, and paired T-tests, along with examples and calculations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views38 pages

T Test

This document provides an overview of hypothesis testing, focusing on the Student's T-test as a method for comparing means between groups. It explains the concepts of null and alternative hypotheses, the significance level, and factors affecting confidence intervals. Additionally, it details the types of T-tests, including one-sample, independent two-sample, and paired T-tests, along with examples and calculations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Biostatistics

B.Sc. (H) Botany, IIIrd year

Unit 5: THE STUDENT’S T - TEST (Hypothesis testing)

Dr. Shagun Danda


STATISTICAL INFERENCE:

HYPOTHESIS:
A hypothesis is an idea or proposition or statement that can be tested by observations or
experiments.

INFERENTIAL STATISTICS AND HYPOTHESIS TESTING

Inferential statistics because it allows us to measure behaviour in samples to learn more


about the behaviour in populations that are often too large.
HYPOTHESIS TESTING:
v The method in which we select samples to learn more about characteristics in a given population is called
hypothesis testing.
v Hypothesis testing is really a systematic way to test claims or ideas about a group or population.

Step 1: State the hypotheses.


Step 2: Set the criteria for a decision.
Step 3: Compute the test statistic.
Step 4: Make a decision.
TYPES OF HYPOTHESIS: Two types

NULL HYPOTHESIS (H0):


The null hypothesis (H0), stated as the null, is a statement about a popula?on parameter, such as the
popula?on mean, that is assumed to be true.
The null hypothesis is a star?ng point. We will test whether the value stated in the null hypothesis is likely to be
true.

ALTERNATIVE HYPOTHESIS.
An alternaIve hypothesis (H1) is a statement that directly contradicts a null hypothesis by sta?ng that the
actual value of a popula?on parameter is less than, greater than, or not equal to the value stated in the null
hypothesis.

TESTING OF NULL HYPOTHESIS:


Hypothesis test as a way of quan?fying the evidence against the null hypothesis.

The evidence against the null hypothesis is es?mated based on the sample data and expressed using a
probability (p-value).
CONFIDENCE LEVEL OR P-VALUES OR
SIGNIFICANCE LEVEL
v The confidence level tells you how
sure you can be.
v P-values are from 0% to 100%. They
are usually written as a decimal.
v The 95% confidence level means
you can be 95% certain so a p-value
of 5% is 0.05. Low p-values are
good; They indicate your data did
not occur by chance. Therefore 99%
confidence level means you can be
99% certain so here a p-value of .01
means there is only a 1%
probability that the results from an
experiment happened by
LEVEL OF SIGNIFICANCE OR CRITICAL REGION:

v The significance level or critical region, also denoted as alpha or α, is a measure of the strength of the
evidence that must be present in your sample before you will reject the null hypothesis.

v The critical region is chosen so that the probability of rejecting the null hypothesis, when it is true, is no
greater than a predetermined value α, called the significance level of the test.

v The null hypothesis is rejected if the value of the test statistic falls within the critical region, Otherwise null
hypothesis not rejected.

v The significance level is typically set equal to such values as 0.10, 0.05, and 0.01. The 5 percent level of
significance, that is, α=0.05, has become the most common in practice.

v For one tail 5% and for two tail it will be 2.5


FACTORS THAT AFFECT CONFIDENCE INTERVALS:
There are three factors that determine the size of the confidence interval for a given
confidence level:
v Sample size: The larger your sample size, the more sure you can be that their answers
truly reflect the population.
v Percentage: Your accuracy also depends on the percentage of your sample that picks a
particular answer. If 99% of your sample said "Yes" and 1% said "No," the chances of
error are remote, irrespective of sample size.
v Population size: he Survey System ignores the population size when it is "large" or
unknown. The confidence interval calculations assume you have a genuine random
sample of the relevant population. If your sample is not truly random, you cannot rely
on the intervals.
T –Test
A T – test is a statistic that checks if two means (averages) are relatively different
from each other.

Why not just look at the means?


Means may show a difference but we can it be sure if that is a reliable difference.

Is this means you are reliably


more heads than me?
No, it is not due to real
difference this is because of
chance
Descriptive statistics vs inferential statistics

Descriptive statistics : describes the data you have but can’t be generalized beyond that.
Inferential Statistics : Allows us to make inference about the population beyond the
samples of our data

Example : These two means are different but does the drug actually working? So we
need inferential statistics.
T-TESTS:
v The t-test is one of many tests used for the purpose of hypothesis testing in statistics.
v The t test (also called Student’s T Test), A t-test is a type of inferential statistic used to
compares two averages (means) and determine if there is a significant difference
between the means of two groups, which may be related in certain features. In other
words it lets you know if those differences could have happened by chance.

v Calculating a t-test requires three key data values. They include the difference between
the mean values from each data set (called the mean difference), the standard deviation
of each group, and the number of data values of each group.

v The outcome of the t-test produces the t-value. This calculated t-value is then compared
against a value obtained from a critical value table (called the T-Distribution Table). This
comparison helps to determine the effect of chance alone on the difference, and whether
the difference is outside that chance range.
v The larger the t score, the more difference there is between groups. The smaller the t
score, the more similarity there is between groups.
WHAT IS TWO-TAILED AND A ONE-TAILED TEST:
The type of alterna^ve hypothesis Ha defines if a test is one-tailed or two-tailed.

TWO-TAILED HYPOTHESIS TESTS:


v Two-tailed hypothesis tests are also known as nondirec^onal and two-sided tests because
you can test for effects in both direc^ons.

ONE-TAILED TESTS:
v A One-tailed test is associated to an alterna^ve hypothesis for which the sign of the
poten^al difference is known before running the experiment and the test.
THERE ARE THREE MAIN TYPES OF T-TEST:
Types of t-tests (with Solved Examples in R)
One-Sample t-test: A One sample t-test tests the mean of a single group against a known mean. If there is one group
being compared against a standard value (e.g. comparing the acidity of a liquid to a neutral pH of 7), perform a one-
sample t-test. OR ONE-SAMPLE
Independent Two-Sample t-test:
Hypothesis tests for two means (independent samples): An Independent Samples t-
test compares the means for two groups: If the groups come from two different populations
(e.g. two different species, or people from two separate cities), perform a two-sample t-
test OR independent t-test

When is zero, we can simplify the test statistic:


PAIRED T-TEST: A Paired sample t-test compares means from the same group at different
times. If the groups come from a single population (e.g. measuring before and after an
experimental treatment), perform a paired t-test. (For this test to be valid the differences
only need to be approximately normally distributed.
Therefore, it would not be advisable to use a paired t-test where there were any extreme
Outliers)

ΣD: Sum of the differences (Sum of X-Y from Step 2)


ΣD2: Sum of the squared differences (from Step 4)
(ΣD)2: Sum of the differences (from Step 2), squared.
DEGREES OF FREEDOM:
Degrees of freedom refers to the values in a study that has the freedom to vary and are
essential for assessing the importance and the validity of the null hypothesis.
Computation of these values usually depends upon the number of
data records available in the sample set.

Correlated or paired t-tests are of a dependent type, as these involve cases where the
two sets of samples are related.
One-Sample t-test

Q 1: The average IQ of a population is 120 (µ). The medication provided to check the effect on IQ on the population. 12
samples were selected from the population and calculate the sample mean, sample standard deviation and do the T-test
analysis at (α)=0.05 S.N I Q Score X x̅ (x-x̅) (x-x̅)2

1 110 121.08 -11.08 122.766


2 110 121.08 -11.08 122.766
3 130 121.08 8.92 79.566
4 140 121.08 18.92 357.96
5 120 121.08 -1.08 1.16
6 100 121.08 -21.08 444.36
7 116 121.08 -5.08 25.806
8 120 121.08 -1.08 1.16
9 122 121.08 1.08 1.16
10 130 121.08 8.92 79.566
11 135 121.08 13.92 193.76
12 120 121.08 -1.08 1.16
ΣX=1453 Σ(x-x)̅ 2 =
PAIRED SAMPLES T TEST BY HAND
Sample ques<on: Calculate a paired t test by hand for the following data:

Step 1: Subtract each Y score from each X score.


Step 2: Add up all of the values from Step 1. Set this number aside
for a moment.
Step 3: Square the differences from Step 1.
Step 4: Add up all of the squared differences from Step 3.

Step 5: Use the following formula to calculate the t-score:

ΣD: Sum of the differences (Sum of X-Y from Step


2)
ΣD2: Sum of the squared differences (from Step 4)
(ΣD)2: Sum of the differences (from Step 2),
squared.
Table value= 2.228
Step 6: Subtract 1 from the sample size to get the degrees of freedom. We have
11 items, so 11-1 = 10.

Step 7: Find the p-value in the t-table, using the degrees of freedom in Step 6.
If you don’t have a specified alpha level, use 0.05 (5%). For this sample problem,
with df=10, the t-value is 2.228.

Step 8: Compare your t-table value from Step 7 (2.228) to your calculated t-
value (-2.74). The calculated t-value is greater than the table value at an alpha
level of .05. The p-value is less than the alpha level: p <.05. We can reject the null
hypothesis that there is no difference between means.
Note: You can ignore the minus sign when comparing the two t-values, as ±
indicates the direction; the p-value remains the same for both directions.
Example
Using the above example with n = 20 students, the following results were obtained:

T = 3.231
Example 1

Experimental study of the effect of the exposure of the fish, Tilapia mossambica
to sublethal concentration of dichlorvos for 12 hours showed the following results
pertaining to O2 consumption (mg/g/h).
The calculated t far exceeds the tabulated t at p=0.001 with degree of
freedom 9. Thus the O2 consumption by the fish after exposure to sublethal
concentration of dichlorovs changes to a very large extent. In other words
the mean decreas in O2 consumption by fish after the exposure is highly
significant.
Practice Questions

Q2

You might also like