0% found this document useful (0 votes)
25 views97 pages

Cse-613 - Mod 4

Uploaded by

Nikunj Shah3540
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views97 pages

Cse-613 - Mod 4

Uploaded by

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

Statistics and Probability

Distribution Analysis
Course Code CSE-613
Faculty Name: Dr Mehak Ranishree
Module 4
Theory of Statistical Inference
Introduction
◎ Random Sampling is a method of probability sampling where a
researcher randomly chooses a subset of individuals from a larger
population.

◎ In this method, every individual has the same probability of being


selected. The researcher aims to collect data from as large a portion as
possible of this randomly chosen subset.
Sample
◎ Probability sampling: Probability sampling is based on the fact that every
member of the population has equal chances of being selected. In probability
sampling, the population unit cannot be selected at the discretion of the
researcher. This method is also known as random sampling. There are some
techniques that are used in probability sampling they are given below,

◎ Simple random sampling -> Cluster sampling

◎ Stratified Sampling -> Disproportionate sampling

◎ Proportionate sampling -> Optimum allocation stratified sampling

◎ Multi-stage sampling
Sample
◎ Non-Probability Sampling

◎ In non-probability sampling, the population units can be selected at the discretion


of the researcher. Those samples will use the human judgements for selecting
units and has no theoretical basis for estimating the characteristics of the
population. Some of the techniques used for non-probability sampling are

◎ Quota sampling

◎ Judgement sampling

◎ Purposive sampling
Introduction
◎ In the field of statistics, sampling serves as the technique for selecting a
portion of the population to draw statistical inferences.

◎ This subset's characteristics allow us to estimate the attributes of the entire


population.

◎ In the realm of market research, sampling methods fall into two primary
categories: Random or probability sampling and non-probability
sampling.
Introduction
◎ What is Probability Sampling?
○ The probability sampling method utilizes some form of random selection.
○ In this method, all the eligible individuals have a chance of selecting the sample from the whole
sample space.
○ This method is more time consuming and expensive than the non-probability sampling method.
○ The benefit of using probability sampling is that it guarantees the sample that should be the
representative of the population.
Probability Sampling Types
◎ Probability Sampling methods are further classified into different types,

such as
○ simple random sampling,

○ systematic sampling,

○ stratified sampling, and

○ clustered sampling
Types
◎ Simple Random Sampling
○ In simple random sampling technique, every item in the population has an equal and likely chance of
being selected in the sample.
○ Since the item selection entirely depends on the chance, this method is known as “Method of chance
Selection”.
○ As the sample size is large, and the item is chosen randomly, it is known as “Representative Sampling”.
○ Example:
◉ Suppose we want to select a simple random sample of 200 students from a school. Here, we can
assign a number to every student in the school database from 1 to 500 and use a random number
generator to select a sample of 200 numbers.
Types
◎ Systematic Sampling
○ In the systematic sampling method, the items are selected from the target population by selecting the random
selection point and selecting the other methods after a fixed sample interval.
○ It is calculated by dividing the total population size by the desired population size.
○ Example:
◉ Suppose the names of 300 students of a school are sorted in the reverse alphabetical order. To select a
sample in a systematic sampling method, we have to choose some 15 students by randomly selecting a
starting number, say 5. From number 5 onwards, will select every 15th person from the sorted list. Finally,
we can end up with a sample of some students.
Types
◎ Stratified Sampling
○ In a stratified sampling method, the total population is divided into smaller groups
to complete the sampling process.
○ The small group is formed based on a few characteristics in the population.
○ After separating the population into a smaller group, the statisticians randomly
select the sample.
○ For example,
◉ there are three bags (A, B and C), each with different balls. Bag A has 50 balls,
bag B has 100 balls, and bag C has 200 balls. We have to choose a sample of balls
from each bag proportionally. Suppose 5 balls from bag A, 10 balls from bag B
and 20 balls from bag C.
Types
◎ Clustered Sampling
○ In the clustered sampling method, the cluster or group of people are formed from
the population set.
○ The group has similar significatory characteristics.
○ Also, they have an equal chance of being a part of the sample.
○ This method uses simple random sampling for the cluster of population.
○ Example:
◉ An educational institution has ten branches across the country with almost the
number of students. If we want to collect some data regarding facilities and
other things, we can’t travel to every unit to collect the required data. Hence, we
can use random sampling to select three or four branches as clusters. All these
four methods can be understood in a better manner with the help of the figure
given below. The figure contains various examples of how samples will be taken
from the population using different techniques.
What is Non-Probability Sampling?
◎ The non-probability sampling method is a technique in which the researcher
selects the sample based on subjective judgment rather than the random
selection. In this method, not all the members of the population have a
chance to participate in the study.

◎ Non-Probability Sampling Types

◎ Non-probability Sampling methods are further classified into different types,


such as convenience sampling, consecutive sampling, quota sampling,
judgmental sampling, snowball sampling.
Types
◎ Convenience Sampling
○ In a convenience sampling method, the samples are selected from the population directly because they are conveniently available for the researcher.
○ The samples are easy to select, and the researcher did not choose the sample that outlines the entire population.
○ Example: In researching customer support services in a particular region, we ask your few customers to complete a survey on the products after the purchase. This is a
convenient way to collect data. Still, as we only surveyed customers taking the same product. At the same time, the sample is not representative of all the customers in
that area.

◎ Consecutive Sampling
○ Consecutive sampling is similar to convenience sampling with a slight variation.
○ The researcher picks a single person or a group of people for sampling.
○ Then the researcher researches for a period of time to analyze the result and move to another group if needed.

◎ Quota Sampling
○ In the quota sampling method, the researcher forms a sample that involves the individuals to represent the population based on specific traits or qualities.
○ The researcher chooses the sample subsets that bring the useful collection of data that generalizes the entire population.
Qualitative or Categorical Data
◎ Purposive or Judgmental Sampling
○ In purposive sampling, the samples are selected only based on the researcher’s knowledge.

○ As their knowledge is instrumental in creating the samples, there are the chances of obtaining highly accurate

answers with a minimum marginal error.

○ It is also known as judgmental sampling or authoritative sampling.


Important Terms Related to Statistics
• What is Random Sampling?
Random sampling is a method used in statistics to select a subset of individuals or items from a larger
population in such a way that each member of the population has an equal and independent chance of being
included in the sample. It is a fundamental technique for conducting surveys and experiments.
• Random Sampling Definition
Random sampling is a method employed for selecting observations from a population, facilitating
generalization about the entire population.
Random Sampling is sometimes referred to as probability sampling, distinguishing it from non-probability
sampling. This method encompasses various techniques, including simple random sampling, stratified
sampling, cluster sampling, and multistage sampling. However, it should be noted that convenience samples,
which are non-arbitrary, fall outside the realm of probability sampling.
How to Perform Simple Random
o Sampling
Define the Population: Clearly identify the entire group from which you want to draw a sample.
o Assign Numbers: Assign a unique number to each member of the population.
o Use a Random Method: Select members using a random method, such as:
o Random Number Generator: Use software or a calculator to generate random numbers
corresponding to the assigned numbers.
o Lottery Method: Write numbers on slips of paper, mix them, and draw the required number of
slips.
o Select Sample Size: Determine the sample size you need and select that number of individuals
based on the random method used.
o Collect Data: Gather data from the selected individuals to conduct your study.
Random Sampling Formula
o Formula of random sampling is mentioned as below:

P = 1 –[(N-1)/N] × [(N-2)/(N-1)] × . . . × [(N-n)/(N-(n-1))]

Where, P = 1 - (1 - (1/N))n

 P represents probability, Where,

 n represents sample size, and  P represents probability,

 N represents population.  n represents sample size, and

In above formula cancelling 1-(N-n/n), it will yield a value of P = n/N.  N represents population.

So, sample getting selected for a chance of more than once


Advantages of Simple Random Sampling
• Simple random sampling is unbiased form of sample classification.

• Simple random sampling is easy to implement and cost-effective.

• Simple random sampling ensures that each element in the population has an equal probability
of being included in the sample.

• Simple random sampling is a reliable way to estimate population characteristics.


Disadvantage of Simple Random
 Sampling
Not Always Feasible: It can be impractical for very large populations due to time and resource
constraints in listing and accessing every member.

 Population List Required: A complete and accurate list of the population is needed, which can be
difficult to obtain.

 Potential for Sampling Error: Random selection might still result in an unrepresentative sample,
especially with small sample sizes.

 Resource Intensive: It may require significant resources and effort to ensure true randomness
and to contact selected individuals.

 Difficulty in Subgroup Analysis: It may not adequately capture smaller subgroups within the
population, making it challenging to analyze these subgroups separately.
Random Sampling vs Non-Probability
Aspect
Sampling Probability Sampling (Random Sampling)

Random or systematic selection based on a known probability


Non-Probability Sampling

Non-random or subjective selection without a known probability


Method of Selection distribution. distribution.

Likely to yield a representative sample of the population, reducing


May result in a non-representative sample, potentially introducing bias.
Representativeness bias.

Generalizability may be limited due to the potential for bias in the


Results are more easily generalized to the entire population.
Generalizability sample.

Easier to calculate sample size requirements based on probability Sample size determination may be more arbitrary and less statistically
Sample Size Determination theory. rigorous.

Types of Probability Simple Random Sampling, Systematic Sampling, Stratified Sampling, Convenience Sampling, Judgmental Sampling, Snowball Sampling,
Sampling Methods Cluster Sampling. Quota Sampling.

Suitable for making statistical inferences and drawing conclusions Limited suitability for making statistical inferences about the entire
about the population. population.
Statistical Inference
Generally provides more precise and accurate estimates when May result in less precise and accurate estimates, depending on the
Precision and Accuracy properly conducted. sampling method used.

Random errors can be quantified and controlled, making it more More susceptible to random errors due to non-random selection
Random Error reliable. methods.

Better control over selection bias and the potential for under May introduce selection bias and potential for under representation or
representation or over representation. over representation.
Bias Control

Drawing a random sample of registered voters using a random Surveying people who are conveniently available in a shopping mall for
number generator. an opinion poll.
Examples
◎ Random Sampling Examples
◎ Example 1: A company has 500 products, and they want to
randomly select 20 of them for quality testing. What is the
probability of any single product getting selected?
◎ Solution:
◎ The chance of one-time selection is:
◎ P = n/N
◎ ⇒ P = 20/500
◎ ⇒ P = 4%
◎ Example 2: In a conference with 200 attendees, 50 will be
randomly chosen for a survey. What is the probability that
one attendee gets selected more than once?
◎ Solution:
◎ The probability of getting selected more than once is:
◎ P = 1 - (1 - (1/N))n
◎ ⇒ P = 1 - (1 - (1/200))50
◎ ⇒ P ≈ 9.56%
◎ Example 3: A university has 1,200 students, and they want to
select 100 students for a survey using simple random
sampling. What is the probability of any single student being
chosen?
◎ Solution:
◎ The chance of one-time selection is:
◎ P = n/N
◎ ⇒ P = 100/1200
◎ ⇒ P = 8.33%.
◎ Example 4: In a raffle, 50 tickets are drawn from a pool of
1,000 tickets. What is the probability that a specific ticket
does not get selected?
◎ Solution:
◎ The chance of a specific ticket not being selected is:
◎ P = 1 - (n/N)
◎ ⇒ P = 1 - (50/1000)
◎ ⇒ P = 95%.
◎ Example 5: A deck of 52 playing cards is shuffled, and 5 cards
are drawn with replacement. What is the probability of
drawing a specific card (e.g., the Ace of Spades) at least once?
◎ Solution:
◎ The probability of drawing a specific card at least once when
drawing 5 cards with replacement is:
◎ P = 1 - (1 - (1/N))n
◎ ⇒ P = 1 - (1 - (1/52))5
◎ ⇒ P ≈ 9.36%.
null and alternative hypotheses
◎ In statistics, the null hypothesis (denoted as (H_0)) and the alternative
hypothesis (denoted as (H_a) or (H_1)) are two competing statements used in
hypothesis testing:
◎ Null Hypothesis ((H_0)): This is the default assumption that there is no effect or no
difference in the population. It suggests that any observed effect in the sample data is
due to random chance. For example, if you're testing a new drug, the null hypothesis
might state that the drug has no effect on patients compared to a placebo.
◎ Alternative Hypothesis ((H_a) or (H_1)): This is the statement that there is an effect
or a difference in the population. It represents what the researcher aims to prove.
Continuing with the drug example, the alternative hypothesis would state that the
drug does have an effect on patients.
◎ In hypothesis testing, you collect sample data and use statistical methods to determine
whether there is enough evidence to reject the null hypothesis in favor of the
alternative hypothesis
Type I and Type II Errors
◎ Type I and Type II errors are subjected to the result of the null hypothesis.
In case of type I or type-1 error, the null hypothesis is rejected though it is
true whereas type II or type-2 error, the null hypothesis is not rejected even
when the alternative hypothesis is true.

◎ Both the error type-i and type-ii are also known as “false negative”. A lot of
statistical theory rotates around the reduction of one or both of these
errors, still, the total elimination of both is explained as a statistical
impossibility.
Type I Error
A type I error appears when the null hypothesis (H0) of an
experiment is true, but still, it is rejected. It is stating something

which is not present or a false hit. A type I error is often called a
false positive (an event that shows that a given condition is
present when it is absent). In words of community tales, a person
may see the bear when there is none (raising a false alarm)
where the null hypothesis (H0) contains the statement: “There is
no bear”. The type I error significance level or rate level is the
probability of refusing the null hypothesis given that it is true. It is
represented by Greek letter α (alpha) and is also known as alpha
level. Usually, the significance level or the probability of type i
error is set to 0.05 (5%), assuming that it is satisfactory to have a
5% probability of inaccurately rejecting the null hypothesis.
Type II Error
A type II error appears when the null hypothesis is false but mistakenly
fails to be refused. It is losing to state what is present and a miss. A type


II error is also known as false negative (where a real hit was rejected by
the test and is observed as a miss), in an experiment checking for a
condition with a final outcome of true or false. A type II error is assigned
when a true alternative hypothesis is not acknowledged. In other words,
an examiner may miss discovering the bear when in fact a bear is
present (hence fails in raising the alarm). Again, H0, the null hypothesis,
consists of the statement that, “There is no bear”, wherein, if a wolf is
indeed present, is a type II error on the part of the investigator. Here, the
bear either exists or does not exist within given circumstances, the
question arises here is if it is correctly identified or not, either missing
detecting it when it is present, or identifying it when it is not present. The
rate level of the type II error is represented by the Greek letter β (beta)
and linked to the power of a test (which equals 1−β).
Table of Type I and Type II Error
The relationship between truth or false of the null hypothesis and outcomes or result of the test is given in
the tabular form:


EXAMPLES

Type I and Type II Errors Example



• Check out some real-life examples to understand the type-i and type-ii error in the

null hypothesis.
Example 1: Let us consider a null hypothesis – A man is not guilty of a
crime.

◎ Then in this case:


Example 2: Null hypothesis- A patient’s signs after treatment A, are the
same from a placebo.

◎ Then in this case:


Sampling distributions of
• chi-sq Test
• t Test
• F Test
10.2 THE CHI-SQUARE DISTRIBUTION
◎ The chi-square (χ2) test belongs to non-parametric category of methods to test a
hypothesis. The calculated value of χ2-test statistic is compared with its critical (or

table) value to know whether the null hypothesis is true. The decision of accepting a
null hypothesis is based on how ‘close’ the sample results are to the expected
results.
◎ Chi-square Test Statistic The χ2-test statistic is given by
Decision Rule: The calculated value of χ2 is compared with its critical value at a particular
level of significance and degrees of freedom. If χ2 cal > χ2 critical, then the null hypothesis is
rejected in favour of the alternative hypothesis and it is concluded that the difference
between two sets of frequencies is significant
10.3 APPLICATIONS OF χ2 TEST

Contingency Table Analysis : Chi-Square Test of Independence

The Procedure The procedure to test the association between two


independent variables where the sample data is presented in the
form of a contingency table with r rows and c columns is
summarized as follows:
Example 14.11: Two hundred randomly selected adults were asked whether
TV shows as a whole are primarily entertaining, educational, or a waste of
time (only one answer could be chosen). The respondents were categorized
by gender. Their responses are given in the following table which is given
below as follows:

Is this evidence convincing that there is a relationship between gender and opinion in
the population interest?
Arranging the observed and expected frequencies in the following table to
calculate the value of χ2- test statistic:

The critical (or table) value of χ2 = 5.99 at α = 0.05 and df = 2. Since the calculated value of χ2 = 16.766 is more
than its critical value, the null hypothesis is rejected. Hence, we conclude that the opinion of adults is not
independent of gender.
Example 12.2: A company is interested in determining whether an
association exists between the commuting time of their employees and the
level of stress-related problems observed on the job. A study of 116
assembly-line workers reveals the following:

At α = 0.01 level of significance, is there any evidence of a significant


relationship between commuting time and stress?
Solution: Let us assume the null hypothesis that stress on the job is
independent of commuting time. The contingency table is of size 3×3, the
degrees of freedom would be (3 – 1) (3 – 1) = 4, that is, we will have to
calculate only four expected frequencies and the others can be calculated
automatically as shown below:

Arranging the observed and expected frequencies in the following table to


calculate the value of χ2- test statistic:
S e l f-P r a c t i c e P r o b l e m s 10A
Note – 10.6 Use the χ2-test to assess the correctness of the hypothesis that the
digits were distributed in equal numbers in the tables from which they were
chosen. [HP Univ., M.Com., 2000]
S e l f-P r a c t i c e Soln

10.6 Let H0 : Digits were distributed in equal numbers. On the basis of H0, E = 200/10 = 20 as the frequency of occurrence for 0, 1, 2, . . .
digits. χ2 cal = 4.3 is less than its critical value χ2 = 16.22 at α = 0.05 and df = 10 – 1 = 9, the null hypothesis is accepted.
10.4 CHI-SQUARE
TEST FOR
GOODNESS-OF-FIT
The χ2 test for goodness-of-fit is a statistical test of how well given data support an assumption about the distribution of a population
or random variable of interest. The test determines how well an assumed distribution fits the given data. The observed frequencies or
values come from the sample and the expected frequencies or values come from the theoretical hypothesized probability distribution.

The Procedure
Example 10.4: A Personnel Manager is interested in trying to
determine whether absenteeism is greater on one day of the week
than on another. His records for the past year show the following
sample distribution:
Day of the week : Monday Tuesday Wednesday Thursday Friday
No. of absentees : 66 56 54 48 75
Test whether the absence is uniformly distributed over the week.
[Madras Univ., M.Com., 1996]
Solution: Let us assume the null hypothesis that the absence is uniformly
distributed over the week. The number of absentees during a week are 300
and if absenteeism is equally probable on all days, then we should expect
300/5 = 60 absentees on each day of the week. Now arranging the data as
follows:
Example 10.5: A survey of 800 families with 4 children each revealed following
distribution:
No. of boys : 0 1 2 3 4
No. of girls : 4 3 2 1 0
No. of families : 32 178 290 236 64
Is this result consistent with the hypothesis that male and female births are
equally probable?

Solution: Let us assume the null hypothesis that male and female births are equally probable.

The probability of a male or female is p = q = 1/2. Since birth of male and female is mutually exclusive and exhaustive, the expected
number of families having different combinations of boys and girls can be calculated using binomial probability distribution as follows:

The calculations for expected frequencies for each combination (category) of boy or girl are as shown below:
than
seem
Example 10.7: A book has 700 pages. The number of pages with various numbers of misprints is
recorded below:

Solution: Let us assume the null hypothesis that the data is fitted with Poisson distribution. The number of
pages in the book are 700, whereas the maximum possible number of misprints are only 5. Thus we may
apply Poisson probability distribution to calculate the expected number of misprints in each page of the book
as follows:
The calculations for expected frequencies for misprints from 0 to 5 are shown
below:
z, t, and F tests
Making inferences from
experimental sample to population
using statistical tests
CONTENTS OF TALK
◎ Distributions and probability – what is a statistical test?
◎ The normal distribution
◎ Inferences from sample to population: hypothesis testing
◎ Central limit theorem
◎ z tests and example
◎ t tests and example
◎ F tests/ANOVA and example
…. and finally….

◎ Statistical tests and SPM


Distribution & Probability
◎ If we know something about the distribution of events, we know something about the
probability that one of these events is likely to occur.
◎ e.g. I know that 75% of people have brown eyes, therefore there is a probability of .75 that the next person I
meet will have brown eyes.

◎ We can use information about distributions to decide how probable it is that the results of an
experiment looking at variable x support a particular hypothesis about the distribution of
variable x in the population.
◎ = central aim of experimental science
◎ This is how statistical tests work: test a sample distribution (our experimental results) against a
hypothesised distribution, resulting in a ‘p’ value for how likely it is that we would obtain our
results under the null hypothesis (null hypothesis = there is no effect or difference between
conditions) – i.e. how likely it is that our results were a fluke!

◎ e.g. in an experiment I measure RT in two different conditions and find a difference between
conditions. I want to know whether my data can statistically support the hypothesis that there
is a genuine difference in RT between these two conditions in the population as a whole, i.e. that
the data come from a population where the means of the two conditions are different. The null
hypothesis is therefore that the means are the same, and I want a probability of less than .05 of
getting the results we obtained under the null hypothesis

A statistical test allows me to ‘test’ how likely it is that the sample data
come from a parent population with a particular characteristic
The Normal Distribution
Many continuous variables follow a normal distribution, and it plays a special role in the statistical tests
we are interested in;

P(x)
• The x-axis represents the values of a particular
variable
68% of dist. • The y-axis represents the proportion of members
of the population that have each value of the
1 s.d. 1 s.d.
variable
• The area under the curve represents probability –
x
e.g. area under the curve between two values on
X
the x-axis represents the probability of an
individual having a value in that range

Mean and standard deviation tell you the basic features of a distribution
mean = average value of all members of the group
standard deviation = a measure of how much the values of individual members vary in relation to the mean
• The normal distribution is symmetrical about the mean
• 68% of the normal distribution lies within 1 s.d. of the mean
Sample to Population
Testing Hypotheses

◎ t,z, and F tests mathematically compare


the distribution of an experimental a normal distribution whose parameters
sample – i.e. the mean and represent some hypothesised feature of
standard deviation of your results to
the population, which you think your
results support

• How does this work? (without going


through the derivation of the equations…!)
• …CENTRAL LIMIT THEOREM
Central Limit Theorem
◎ Special feature of normal distribution which underlies its use in statistical tests…
◎ Take k samples from a population, and calculate the mean of each sample. The
distribution of those means will approximate a normal distribution (for certain
variable types). As k tends to infinity, the distribution of sample means tends to a
normal distribution
◎ Because the means of samples tend towards a normal distribution in this way, we
can convert the mean of our sample distribution (the experimental results) into a
value from a standardised normal distribution.
• A z-test achieves this conversion by performing a
P( X) linear transformation – the equation is given on
the next slide
• This can be thought of as expressing your results
and your hypothesis in the same ‘units’.
68% of dist. • so the z-statistic represents a value on the x-axis
of the standard distribution, for which we know all
1 s.d. 1 s.d.
the p-values

m X

population sample mean


mean
z-tests:
What are they?

formula: x  x sample mean

z  population mean

  population standard deviation

• Plug in the values, and get a ‘z-value’ which corresponds to a location on the x-axis of a
standardised normal distribution (=0, =1)
• For the standardised normal distribution we know the probability of any particular value coming from
it (area under the curve)
• this is what you read off from a table of z-values
• Because we are dealing with the probabilities of hypotheses about our sample, there is always a
chance you are wrong…. Choosing the significance level represents how big you want this chance
to be…
• P<.05 = a 5% chance that you would obtain your result under the null hypothesis (Type 1 error)
z-tests:
Worked Example
◎ Battery of psychological tests to judge IQ from which we have obtained
distribution:
○ Mean = 50
○ S.D. = 10
○ Represents disrtibution of entire population
○ We would like to find out probability of various scores, for ex. Which are
those scores that are so high they can only be obtained by 10% of the
population
◎ Need to transform the distribution to a STANDARD NORMAL DISTRIBUTION:
○ Thus we now have a z distribution z=X-m = X-50
s 10
○ No change in the data since new distribution has same shape + observations stand
in same relation to each other (same as converting inches to centimeters) – we
have performed a LINEAR TRANSFORMATION
◎ Now, a score that was 60 is 1, i.e. the score is 1 S.D. above the mean
◎ A z score represents the number of S.D. that observation Xi is above or below
the mean.
t-tests:
Testing Hypotheses About Means
x sample mean

◎ formula: (x  ) √n  population mean


t s sample standard deviation
s x
x

n = size of sample

• For a z-test you need to know the population mean and s.d. Often you don’t know the s.d. of the
hypothesised or comparison population, and so you use a t-test. This uses the sample s.d. instead.
• This introduces a source of error, which decreases as your sample size increases
• Therefore, the t statistic is distributed differently depending on the size of the sample, like a family of
normal curves. The degrees of freedom (d.f. = sample size – 1) represents which of these curves you
are relating your t-value to. There are different tables of p-values for different degrees of freedom.
\ larger sample = more ‘squashed’ t-statistic distribution = easier to get significance

Kinds of t-tests (formula is slightly different for these different kinds):


• Single-sample: tests whether a sample mean is significantly different from 0
• Independent-samples: tests the relationship between two independent populations
• Paired-samples: tests the relationship between two linked populations, for example means obtained in
two conditions by a single group of participants
t-tests:
Worked Example of Single Sample t-test
◎ We know that finger tapping speed in normal population:
○ Mean=100ms per tap
◎ Finger tapping speed in 8 subjects with caffeine addiction:
○ Mean = 89.4ms
○ Standard deviation = 20ms
◎ Does this prove that caffeine addiction has an effect on tapping speed?
◎ Null Hypothesis H0: tapping speed not faster after caffeine
◎ Preselected significance level was 0.05
◎ Calculate from t value, for ex. T(7)= √8 (89.4 -100) = -1.5
20
◎ Find area below t(7) = -1.5, get 0.07: i.e. 7% of the time we would expect a score
as low as this
◎ This value is above 0.05 => We could NOT reject H0!
◎ We can’t conclude that caffeine addiction has an effect on tapping speed
F-tests / ANOVAs:
What are they?
ANOVA = analysis of variance
involves calculating an F value whose significance is tested (similarly to a z or t value)

◎ Like t-tests, F-tests deal with differences between or among sample means, but with any
number of means (each mean corresponding to a ‘factor’)
◎ Q/ do k means differ? A/ yes, if the F value is significant
◎ Q/ how do the k factors influence each other? A/ look at the interaction effects

◎ ANOVA calculates F values by comparing the variability between two conditions with
the variability within each condition (this is what the formula does)
○ e.g. we give a drug that we believe will improve memory to a group of people and give a
placebo to another group. We then take dependent measures of their memory
performance, e.g. mean number of words recalled from memorised lists.
○ An ANOVA compares the variability that we observe between the two conditions to the
variability observed within each condition. Variability is measured as the sum of the
difference of each score from the mean.
○ Thus, when the variability that we predict (between the two groups) is much greater
than the variability we don't predict (within each group) then we will conclude that our
treatments produce different results.
F-tests / ANOVAs:
What are they?
◎ ANOVA calculates an F value, which has a distribution related to the sample size and number
of conditions (degrees of freedom)
F  MS factors

MS error

◎ The formula compares the variance between and within conditions or ‘factors’ as discussed
above – we won’t worry about the derivation! (n.b. MS = mean squares)
◎ If the F statistic is significant, this tells us that the means of the factors differ significantly
=> are not likely to have come from the same ‘population’ = our variable is having an effect

◎ When can we use ANOVAs?


◎ The formula is based on a model of what contributes to the value of any particular data point,
and how the variance in the data is composed. This model makes a number of assumptions
that must be met in order to allow us to use ANOVA
○ homogeneity of variance
○ normality
○ independence of observations
◎ Remember: when you get a significant F value, this just tells you that there is a significant
difference somewhere between the means of the factors in the ANOVA. Therefore, you often
need to do planned or post-hoc comparisons in order to test more specific hypotheses and
probe interaction effects
ANOVAs:
Worked Example
◎ Testing Differences between independent sample means: Following rTMS over
the Right Parietal cortex, are the incorrectly cued trials in a cued RT task slowed
down compared to the correctly cued trials?
◎ “Repeated measures” ANOVA:
○ 1 group of 14 healthy volunteers
○ Perform 100 trials pre- and 100 trials post- stimulation
○ Real vs Sham rTMS on two separate days
◎ Within-session factors:
○ Correct vs Incorrect trials
○ Pre vs Post
◎ Between-session factors:
○ Real vs Sham rTMS
◎ Null Hypothesis H0: there is no difference in the RTs of incorrectly cued trials
◎ Many possibilities if H0 is rejected:
○ All means are different from each other: meanIC preR vs. meanICpostR vs. meanICpreS vs.
meanICpostS
○ Means in the Real condition are different from means in the Sham
○ Interaction of means might be different (pre_post in Real diff. pre_post in Sham)
Why do we care?
Statistical tests in SPM
◎ Example in a simple block design of the effect of a drug on
right hand movement versus rest:
Factorial Design: 2x2

DRUG
Real Placebo
fMRI:
Acquired
8 measurements, move
2 of each condition

Subjects:
12 healthy volunteers
rest
Counterbalanced order
Why do we care?
Statistical tests in SPM
◎ We perform ANOVAs, t-tests, and f-tests when we create a design matrix and specify
contrasts
◎ Reminder: GLM equation to explain our data y
○ y=Xb+e
○ X is the design matrix: enter this into SPM to tell program how to divide up the
imaging data into the different conditions
○ Each element in the matrix represents one condition

Xb+ e =y
b are the regressors: Allocate regressors specific values to test specific
hypotheses (i.e. CONTRASTS) between conditions
e = error In this case:

Column1 = right movement Y= (b1x1+b2x2+b3x3+b4x4)+e


with drug 1
Column2 = rest with drug
Column3 = right movement
with placebo 2
Column4 = rest with
placebo
3

4
Why do we care?
t-tests in SPM

◎ A t-contrast is a linear combination of parameters: c’ x b


◎ If we think that 1 regressor in our design matrix (e.g. b )
1

could lead to an interesting activation, we compute:


1xb +0xb +0xb +0xb and divide by SD
1 2 3 4

◎ Our question: Is the mean activity in condition 1


significantly different from the mean activity in all other
conditions?
Why do we care?
t-tests in SPM

◎ In SPM, we make the weights sum to 0 when testing specific


hypotheses
◎ T-tests in our study would include:
○ Main effects of movement across all sessions: 1 -1 1 -1
○ Main effects of the drug:
◉ Increases: 1 1 -1 -1
◉ Decreases: -1 -1 1 1
○ Interaction increases: 1 -1 -1 1 1
○ Interaction decreases: -1 1 1 -1
2

4
Why do we care?
F-tests in SPM
◎ An F-test models multiple linear hypotheses: does the design matrix X model
anything?
◎ F-contrasts in our previous example…
○ Are there any differences of the drug and placebo altogether? (i.e. increases AND
decreases)
1 0 -1 0
0 1 0 -1
◎ Used if we want to make more general inferences about data that
○ 1) might not be found with simple averaging (cancellations?)
○ 2) to test for effects that are jointly expressed by some one-dimensional contrasts
◉ 'all effects of interest' to check whether there is any effect at all
○ 3) in case data is modelled in a more complex way (hrf & deriv)
○ 4) when you have multiple regressors and think that the effect expresses itself in
some of them, not only one
○ 5) If you do not have a very clear hypothesis: might be useful to derive more
hypotheses to be tested with t-contrasts
○ => more details will be given later in the course…
Summarize……….
t distribution and F- distribution
References

◎ http://obelia.jde.aca.mmu.ac.uk/rd/arsham/opre330.htm#r
anova
◎ ‘Statistical Methods for Psychology’ (2001), by David Howell
◎ SPM website: http://www.fil.ion.ucl.ac.uk/spm/

You might also like