Module 3
Module 3
Descriptive statistics, Review of hypothesis testing procedures: Parametric tests (z-test, t-test, and F-test) and
Non-parametric test (Chi-square test, One-way and two-way ANOVA) Associative and Predictive analysis:
Correlation and Regression- bivariate and multivariate Multivariate Techniques: Multi-Dimensional scaling,
Data reduction (Factor analysis) and cluster analysis Data Analysis: Introduction to statistical software SPSS
21.0
Descriptive statistics
Descriptive statistics is a branch of statistics focused on summarizing, organizing, and presenting data in a
clear and understandable way. Descriptive statistics is primarily concerned with measures of central
tendency, variability, and distribution, as well as graphical representations of data.
Types of descriptive statistics
There are three types of descriptive statistics:
1. Measures of Central Tendency
2. Measures of Dispersion
3. Measures of Frequency Distribution
• Variance: The variance is the average of squared deviations from the mean. Variance reflects the degree
of spread in the data set. The more spread the data, the larger the variance is in relation to the mean.
To find the variance, simply square the standard deviation. The symbol for variance is s2.
• Standard Deviation: It represents the average deviation of each score from the mean.
There are six steps for finding the standard deviation:
1. List each score and find their mean.
2. Subtract the mean from each score to get the deviation from the mean.
3. Square each of these deviations.
4. Add up all of the squared deviations.
5. Divide the sum of the squared deviations by N – 1.
6. Find the square root of the number you found.
Example: Calculate standard deviation of the following data series:
3. Frequency distribution
A data set is made up of a distribution of values, or scores. In tables or graphs, you can summarize the
frequency of every possible value of a variable in numbers or percentages. This is called a frequency
distribution.
• State your research hypothesis as a null hypothesis and alternate hypothesis (Ho) and (Ha or H1).
• Collect data in a way designed to test the hypothesis.
• Perform an appropriate statistical test.
• Decide whether to reject or fail to reject your null hypothesis.
• Present the findings in your results and discussion section.
NULL HYPOTHESIS
The Null hypothesis (denoted as H0) states that there is no difference between the population parameter and
the sample statistic being compared. The null hypothesis in statistics states that there is no difference
between groups or no relationship between variables. Null Hypothesis is the hypothesis that is always tested
for acceptance or rejection. If we are to compare method A with method B about its superiority and if we
proceed on the assumption that both methods are equally good, then this assumption is termed as the null
hypothesis (H0).
Suppose we want to test the hypothesis that the population mean () is equal to the hypothesized mean (H0)
= 100.
Then we would say that the null hypothesis is that the population mean is equal to the hypothesized mean
100 and symbolically we can express as:
H0 : = H0 = 100
ALTERNATIVE HYPOTHESIS
The Alternative hypothesis (denoted as H1) states that there is a difference between the population parameter
and sample statistic. If we accept H0, then we are rejecting H1 and if we reject H0, then we are accepting H1.
Example: We may think that the method A is superior or the method B is inferior, then we are stating
alternative hypothesis (Ha).
For H0: = H0 = 100, we may consider three possible alternative hypotheses as follows
• CONFIDENCE LEVEL
The confidence level is the probability of accepting the null hypothesis when it (H0) happens to be true.
In other words, confidence level is the expected percentage of times that the actual value will fall within
the stated precision limits. Thus, if we take a confidence level of 95%, then we mean that there are 95
chances in 100 (or 0.95 in 1) that the sample results represent the true condition of the population within
a specified precision range against 5 chances in 100 (or 0.05 in 1) that it does not.
Confidence level indicates the likelihood that the answer will fall within that range, and the significance
level indicates the likelihood that the answer will fall outside that range. We can always remember that
If the confidence level is 95% (0.95), then the significance level will be (100 – 95) i.e., 5% (0.05).
If the confidence level is 99% (0.99), the significance level is (100 – 99) i.e., 1% (0.01).
If the confidence level is 90% (0.90), the significance level is (100 – 90) i.e., 10% (0.10).
It may also be denoted as acceptance region.
Though efforts are made to reduce both Type I and Type II Errors, but it is not possible to reduce both at
the same time. Generally, and are inversely related to each other that if we reduce the probability of
Type I error () from 0.05 to 0.01, we simultaneously increase the probability of committing Type II
Error (). The value of can be reduced only by increasing the value of .
However in general it is more risky to accept a false hypothesis (or commit Type II Error) than to reject a
true hypothesis (or commit a Type I error). The probability of committing a Type I error (rejecting a true
hypothesis) is kept at 5 per cent level or the probability of rejecting a correct hypothesis is generally
fixed at 0.05. In other words the critical region is 5 per cent and acceptance region is 95 per cent.
2) Select an appropriate test→ To test the null hypothesis, it is necessary to select an appropriate
statistical test. It is used to test whether the null hypothesis set-up should be accepted or rejected. Some
probability distributions that are commonly used in testing procedures are t, z, and 2. Test criteria must
employ an appropriate probability distribution. If the sample size is less than 30 (n < 30) then t-test
should be used, but when n 30, then z test should be used.
3) Set the suitable significance level→ The next step is to test its validity at a certain level of significance
(). The confidence with which a null hypothesis is rejected or accepted depends upon the significance
level use for the purpose. The significance level is also known as the size of the rejection region or the
size of the critical region. Generally, in practice, either 5% (0.05) level or 1% (0.01) level is adopted for
the purpose. The factors that affect the level of significance are:
a) The extent of the difference between sample means;
b) The size of the samples;
c) The variability of measurements within samples; and
d) Whether the hypothesis is directional or non-directional.
4) Calculation and Critical Value→ The next step is to calculate the appropriate value from the sample
data concerning the test statistic, necessary for the application of that particular test. Also get the
tabulated value of confidence level.
5) Making decision→ lastly, a decision should be arrived as to whether the null hypothesis is to be
accepted or rejected. In this regard the value of the test statistic calculated to test the hypothesis plays a
very important role. If the calculated value of the test statistic is less than the critical value, the computed
value of the test statistic falls in the acceptance region and the null hypothesis is accepted. If the
calculated value of the test statistic is greater than the critical value, the calculated value of the test
statistic falls in the rejection region and null hypothesis is rejected. Usually 5% level of significance =
0.05 is used in testing a hypothesis and taking a decision unless otherwise any other level of significance
is specifically stated.
There are 3 types of t-tests that could be performed on the n number of samples collected.
• One-sample test,
• Independent sample t-test and
• Paired samples t-test
We perform a One-Sample t-test when we want to compare a sample mean with the population mean. We
use the sample standard deviation instead of population standard deviation in this case.
Independent Sample T-Test
Students t-test is used to compare the mean of two groups of samples. It helps evaluate if the means of the
two sets of data are statistically significantly different from each other.
Where,
t = Student's t-test
x1 = mean of first group
x2= mean of second group
s1 = standard deviation of group 1
s2 = standard deviation of group 1
n1= number of observations in group 1
n2= number of observations in group 2
where
t = Student's t-test
x1−x2= Difference mean of the pairs
s= standard deviation
n = sample size
What is Z-Test?
Z-test is a statistical test that is used to determine whether the mean of a sample is significantly different
from a known population mean when the population standard deviation is known. It is particularly useful
when the sample size is large (>30).
Here, our level of significance is given in this question ( =0.05), if not given then we take ∝=0.05 in
general.
Now, we compute the Z-Score:
X = 110
Mean = 100
Standard Deviation = 15
Number of samples = 50
Now, we look up to the z-table. For the value of ∝=0.05, the z-score for the right-tailed test is 1.645.
Here 4.71 >1.645, so we reject the null hypothesis.
If the z-test statistics are less than the z-score, then we will not reject the null hypothesis.
What is F-Test?
The F test is a statistical technique that determines if the variances of two samples or populations are equal
using the F test statistic. Both the samples and the populations need to be independent and fit into an F-
distribution. The null hypothesis can be rejected if the results of the F test during the hypothesis test are
statistically significant; if not, it stays unchanged.
Here,
Fcalc = Critical F-value.
σ12 & σ22 = variance of the two samples.
Here,
df = Degrees of freedom of the sample.
nS = Sample size.
df=ns-1
For Numerical Click link F Test Formula: Definition, Formula, Solved Examples ([Link])
Non-parametric tests are the mathematical methods used in statistical hypothesis testing, which do not make
assumptions about the frequency distribution of variables that are to be evaluated. The non-parametric
experiment is used when there are skewed data, and it comprises techniques that do not depend on data
pertaining to any particular distribution.
Chi-Square (Χ²)
A Pearson’s chi-square test is a statistical test for categorical data. It is used to determine whether your data
are significantly different from what you expected. It can also be used to make comparisons between
theoretical populations and actual data when categories are used. There are two types of Pearson’s chi-
square tests:
• The chi-square goodness of fit test is used to test whether the frequency distribution of a categorical
variable is different from your expectations. When some theoretical distribution is fitted to the given
data, we are always interested in knowing as to how well this distribution fits with the observed data.
If the calculated value of χ2 is less than the table value at a certain level of significance, the fit is
considered to be a good one which means that the divergence between the observed and expected
frequencies is attributable to fluctuations of sampling. But if the calculated value of χ2 is greater than
its table value, the fit is not considered to be a good one.
• The chi-square test of independence is used to test whether two categorical variables are related to
each other.
Where:
The larger the difference between the observations and the expectations (O − E in the equation), the bigger
the chi-square will be. To decide whether the difference is big enough to be statistically significant, you
compare the chi-square value to a critical value. If the calculated value of χ2 is equal to or exceeds the table
value, the difference between the observed and expected frequencies is taken as significant, but if the table
value is more than the calculated value of χ2, then the difference is considered as insignificant.
A shopkeeper wants to know if the type of product sold is independent of the time of the day. He
collects the following data:
The shopkeeper wants to test whether the type of product sold is independent of the time of the day at a 5%
significance level (α = 0.05).
One-way and two-way ANOVA
ANOVA (Analysis of Variance) is a statistical method used to compare the averages (means) of three or
more groups to see if they are significantly different from each other.
Imagine you have three different types of fertilizers, and you want to find out which one helps plants grow
the tallest. You plant seeds using each fertilizer and measure the plant heights after some time.
• If the average heights of the plants are very different, you might think that the fertilizers have
different effects.
• But sometimes, differences happen just by chance. ANOVA helps you check if the differences are
real (statistically significant) or just due to random variation.
Key Points:
• More than two groups: If you have only two groups, a simple t-test would work. ANOVA is needed
when you have three or more groups.
• Finds overall difference: ANOVA tells you if there is a difference somewhere, but it does not tell
you which groups are different. You may need further tests for that.
• Uses Variance: It looks at how much variation exists within each group and between groups. If the
variation between groups is much larger than within groups, the difference is likely significant.
Associative Analysis shows the relationships or associations between variables in a dataset. Example:
Given transaction data from a supermarket, associative analysis can identify which items are frequently
purchased together. For instance, it might reveal that customers who buy bread are likely to buy butter as
well.
Predictive Analysis involves using historical data to make predictions about future outcomes. Example:
Predictive analysis can be applied to various scenarios. For instance:
Correlation is the relationship or association between two variables. There are multiple ways to measure
correlation, but the most common is Pearson's correlation coefficient (r), which tells you the strength of the
linear relationship between two variables. The value of r has a range of -1 to 1 (0 indicates no relationship).
Values of r closer to -1 or 1 indicate a stronger relationship and values closer to 0 indicate a weaker
relationship.
Regression is a statistical method for estimating the relationship between two or more variables. In theory,
regression can be used to predict the value of one variable (the dependent variable) from the value of one or
more other variables (the independent variable/s or predictor/s). There are many different types of
regression, depending on the number of variables and the properties of the data that one is working with, and
each makes assumptions about the relationship between the variables.
Bivariate analysis
Bivariate analysis is slightly more analytical than Univariate analysis. When the data set contains two
variables and researchers aim to undertake comparisons between the two data set then Bivariate analysis is
the right type of analysis technique.
Here is one simple example of bivariate analysis –
In a survey of a classroom, the researcher may be looking to analysis the ratio of students who scored above
85% corresponding to their genders. In this case, there are two variables – gender = X (independent variable)
and result = Y (dependent variable). A Bivariate analysis is will measure the correlations between the two
variables.
Bivariate analysis is conducted using –
•Correlation coefficients
•Regression analysis
Multivariate analysis
Multivariate analysis is a more complex form of statistical analysis technique and used when there are more
than two variables in the data set.
Here is an example of multivariate analysis –
A doctor has collected data on cholesterol, blood pressure, and weight. She also collected data on the eating
habits of the subjects (e.g., how many ounces of red meat, fish, dairy products, and chocolate consumed per
week). She wants to investigate the relationship between the three measures of health and eating habits?
In this instance, a multivariate analysis would be required to understand the relationship of each variable
with each other.
Commonly used multivariate analysis technique include –
•Factor Analysis
•Cluster Analysis
•Variance Analysis
•Discriminant Analysis
•Multidimensional Scaling
•Principal Component Analysis
Redundancy Analysis
MULTI-DIMENSIONAL SCALING
example
To illustrate the basic mechanics of MDS it is useful to start with a very simple example. The distance
matrix below shows the distance, in kilometers, between four Australian cities. From these distances alone,
we can reconstruct the map (shown below) which shows the distance between the cities.
• MDS can be applied to a wide range of data types, including numerical, categorical, and mixed data.
This makes MDS a versatile tool that can be used with many different kinds of data and allows it to
handle complex multi-modal data sets.
• MDS is widely used in many fields, including machine learning, data mining, and pattern
recognition. This makes it a well-established and widely-supported technique that has been
extensively tested and validated, and that has a large and active user community.
• It relies on the distances between the data points to define the projection and does not consider other
types of relationships between the data points, such as correlations or associations. This means that
MDS may not be suitable for data sets that have complex, non-distance-based relationships, or that
have missing or noisy distances.
• It is sensitive to outliers and noise in the data, which can affect the quality of the projection and the
interpretability of the results. MDS may produce projections that are distorted or misleading if the
data contains outliers or noise, and may not accurately reflect the underlying structure of the data.
Factor analysis is a technique that is used to reduce a large number of variables into fewer numbers of
factors. This technique extracts maximum common variance from all variables and puts them into a
common score. As an index of all variables, we can use this score for further analysis. Factor analysis is
part of general linear model (GLM) and this method also assumes several assumptions: there is linear
relationship, there is no multicollinearity, it includes relevant variables into analysis, and there is true
correlation between variables and factors. Several methods are available, but principal component analysis
is used most commonly.
While studying customer satisfaction related to a product, a researcher will usually pose several questions
about the product through a survey. These questions will consist of variables regarding the product’s
features, ease of purchase, usability, pricing, visual appeal, and so forth. These are typically quantified on a
numeric scale. But, what a researcher looks for is the underlying dimensions or “factors” regarding customer
satisfaction. These are mostly psychological or emotional factors toward the product that cannot be directly
measured. Factor analysis uses the variables from the survey to determine them indirectly.
When a researcher assumes these variables from the survey, they are condensed into one or more factors.
Some of the methods used to extract these factors could include:
CLUSTER ANALYSIS
Cluster analysis, also known as clustering, is a method of data mining that groups similar data points
together. The goal of cluster analysis is to divide a dataset into groups (or clusters) such that the data points
within each group are more similar to each other than to data points in other groups. Cluster Analysis is the
process to find similar groups of objects in order to form clusters
For example, consider a dataset of vehicles given in which it contains information about different vehicles
like cars, buses, bicycles, etc. As it is unsupervised learning there are no class labels like Cars, Bikes, etc for
all the vehicles, all the data is combined and is not in a structured manner. Now our task is to convert the
unlabelled data to labelled data and it can be done using clusters.
The main idea of cluster analysis is that it would arrange all the data points by forming clusters like cars
cluster which contains all the cars, bikes clusters which contains all the bikes, etc.
Clustering Methods:
• Partitioning Method
• Hierarchical Method
• Density-based Method
• Grid-Based Method
• Model-Based Method
• Constraint-based Method
Step 1: Formula
𝒏∑𝑿𝒀 − (∑𝑿)(∑𝒀)
𝒓=
√[𝒏∑𝑿𝟐 − (∑𝑿)𝟐 ][𝒏∑𝒀𝟐 − (∑𝒀)𝟐 ]