Cse-613 - Mod 4
Cse-613 - Mod 4
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.
◎ Multi-stage sampling
Sample
◎ Non-Probability Sampling
◎ 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.
◎ 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,
○ 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.
◎ 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
Where, P = 1 - (1 - (1/N))n
In above formula cancelling 1-(N-n/n), it will yield a value of P = n/N. N represents population.
• Simple random sampling ensures that each element in the population has an equal probability
of being included in the sample.
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)
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
null hypothesis.
Example 1: Let us consider a null hypothesis – A man is not guilty of a
crime.
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:
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….
◎ 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
m X
z population mean
• 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
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
◎ 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
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:
4
Why do we care?
t-tests in SPM
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/