0 ratings 0% found this document useful (0 votes) 51 views 13 pages Correlation and Regression
The document discusses correlation and regression as statistical tools for analyzing relationships between variables. Correlation measures the strength and direction of a linear relationship, while regression predicts the value of a dependent variable based on independent variables. It also outlines types of correlation and regression, their formulas, and key differences between the two concepts.
AI-enhanced title and description
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
Save correlation and regression For Later 1512125, 3:22 PM Correlation and Regression | GesksforGeeks
Search...
Correlation and Regression
Last Updated : 26 Aug, 2024
Correlation and regression are essential statistical tools used to analyze
the relationship between variables. Correlation measures the strength and
direction of a linear relationship between two variables, indicating how
one variable changes in response to another. Regression, on the other
hand, goes a step further by not only measuring this relationship but also
predicting the value of a dependent variable based on one or more
independent variables.
In this article, will discuss correlation and regression in more details,
particularly, the significance, uses, and distinctions between them. We aim
to deliver a simple and concise necessitate that may be read by students
and professionals with no prior knowledge of mathematics and must not
overload them with profuse data and difficult terminologies.
Table of Content
« What is Correlation?
© Types of Correlation Coefficients
What is Regression?
© Types of Regression
Correlation and Regression Formula
* Differences Between Correlation and Regression
Solved Problems on Correlation and Regression
FAQs
What is Correlation?
tps: geekstorgecks orgicorelaion-and-regression ans225,922 Comeaton and Regression | GaksforGeis
Correlation quantifies how strong and in which direction the two variables
are related. It is being measured using the correlation coefficient which
goes to the extent of negative one and positive one.
* Positive Correlation: In this case, if the value of one of them goes up,
then the value of the other one also goes up.
* Negative Correlation: That is, when one variable is high, the other is
low and vice versa.
* No Correlation: Not statistically significantly correlated: partners,
financial wealth, and life satisfaction.
Types of Correlation Coefficients
Some of the common correlation coefficients are:
* Pearson Correlation Coefficient: Calculates the form of a straight line
‘that describes the direction of the relationship between two variables
that are both of the interval or ratio scale.
* Spearman's Rank Correlation: Used to establish the level of
connection between two variables that have been ranked.
* Kendall's Tau: Measures the extent to which one variable is ranked
relative to another.
What is Regression?
Regression analysis can be defined as a statistical tool that is applied in an
endeavor to identify the relationship between a dependent variable and
one or many independent variables. Of benefit when trying to forecast the
position of the dependent variable, given the position of independent
variables.
Types of Regression
Common types of regression are:
ntps:www geekstorgecks orgicorelaion-and-regression 231912/25, 2:22 PM Correlation and Reg
ion | GeckforGeots
+ Simple Linear Regression: Looks at two variables and tries to find out if
one makes some contribution on the other through putting in place a
linear equation.
* Multiple Linear Regression: Looks at the effect of more than one
independent variable on one dependent variable.
* Logistic Regression: Applied where the dependent variable is
qualitative.
* Polynomial Regression: Plans the connection between the dependent
variable and the independent variable by an nth-degree polynomial.
Correlation and Regression Formula
Formulas related to Correlation and Regression are:
Correlation Formula: The Pearson correlation coefficient (r) is calculated
using the formula
Simple Linear Regression Formula: The regression line is represented as:
Y=a+bX
Where:
Y is the dependent variable,
X is the independent variable,
ais the intercept,
bis the slope.
Differences Between Correlation and Regression
Some of the common differences between correlation and regression are:
ritps www. geeksforgeeks.orglcortelaton-and-egression! 33512125, 3:22 PM
Correlation and Regression | GesksforGeeks
Feature Correlation
Purpose Measures the strength and
direction of the linear
relationship between two
variables.
Directionality
Does not assume a causal
relationship; measures
association.
Coefficient
Correlation coefficient (r)
ranges from -1 to 1
Equation
No equation involved.
Prediction
Does not predict values.
Types Pearson, Spearman,
Kendall.
oaritu
Number System and Arithmetic Algebra Set Theory
re.ationsnips (in rearson
correlation).
ntps:www geekstorgecks orgicorelaion-and-regression
Probability
Regression
Models the relationship
between a dependent
variable and one or more
independent variables.
Implies a directional
relationship from
independent to dependent
variable.
Regression coefficients
(slope and intercept)
describe the relationship.
Provides an equation (e.g.,
Y=a+bX in simple linear
regression).
Used to predict the value of
the dependent variable
based on independent
variables,
Simple linear, multiple linear,
logistic, polynomial.
Statistics Geome
(depending on the type of
regression).
ans192/25, 2:22PM Correlation and Reg
ssion | GesksforGeeks
Feature Correlation Regression
Data Requires two continuous Requires one dependent and
Requirement variables (for Pearson one or more independent
correlation). variables.
Solved Problems on Correlation and Regression
Problem 1: Given two variables, X and Y, calculate the Pearson correlation
coefficient.
* X:[1, 2,3, 4,5]
+ Y: (2,4, 6, 8, 10]
Solution:
Calculating the mean of X and Y:
* Mean of X (\bar{X}) = 3
* Mean of Y (\bar{Y}) = 6
Calculating the Pearson correlation coefficient:
(1-3)(2-0)42-3)(4-6)+(3-3)(6-6) + (4-99(8-6) 4(5~8)(10-6)
VO 2-37+8-9HES OEP Heo SO) HOOP
121041021204 0 2020
VR orale r0raTT8 — Vioea0 Yao ~ 2
So, the Pearson correlation coefficient (r= 1), indicating a perfect
positive linear relationship between X and Y.
Problem 2: Calculate the Spearman's rank correlation coefficient for the
following data:
* X:[10, 20, 30, 40, 50)
* Y: [30, 40, 10, 20, 50]
Solution:
ritps www. geeksforgeeks.orglcortelaton-and-egression! 5131512125, 3:22 PM Correlation and Regression | GesksforGeeks
1. Rank the data points in X and Y:
* Ranks of X: [1, 2, 3, 4, 5]
+ Ranks of ¥: (3, 4, 1, 2, 5]
2. Calculate the difference between ranks (d;)):
Differences (d): [2, 2, -2, -2, O]
3. Calculate the square of differences (d3)):
Squared differences (d*): [4, 4, 4, 4, O]
4. Sum the squared differences:
Vidi =444444440=16
5. Use the Spearman's rank correlation formula:
r,=1- S54
ey
Here, n=5:
615
51)
1-0.8=02
96
Ia0 =
So, the Spearman's rank correlation coefficient n = 5 , indicating a
weak positive rank correlation between X and Y.
Problem 3: Given data points, predict the value of Y for X = 6 using the
equation ¥ =a + 5X.
* Data points: (1, 2), (2, 4), (3, 6), (4, 8), (5, 10)
Solution:
Calculate the slope (b) and intercept (a):
EVxX-2)(¥-¥)
é LIE
X=3, ¥=6
=a a
fp — PAR +(2-a)(4-0)4(8-2)(6-0)+(4—9)8-0)4(5-9)000-6) _ 20 _ 9
Uae 10
a=Y-bX =6-2-3=0
Equation: Y = 0 + 2X
For X = 6:
ntps:www geekstorgecks orgicorelaion-and-regression ens1512125, 3:22 PM Correlation and Regression | GesksforGeeks
Y=2x6=12
So, the predicted value of Y for X = 6 is 12.
Problem 4: Given the following data, predict the value of Y for X; = 3 and
X2= 4:
Data:
+ (1, Xp ¥)
* (12,3)
* (2,3, 4)
* (3, 4,5)
* (4,5, 6)
* (5,6,7)
Solution:
The multiple linear regression equation is.
Using a statistical software or calculation tool (e.
determine:
Excel, RJ, we can
© by=1
© b2=0
*a=l
So, the equation becomes:
Y=1+1X,+0X>
For Xj = 3 and Xz = 4:
Y=1+1x3+0x4=1+3=4
So, the predicted value of Y for X; = 3 and X2= 4 is 4.
Problem 5: Given the following data, determine the probability of Y being
1 for X = 4:
Data:
° (XY)
ntps:www geekstorgecks orgicorelaion-and-regression m372725, 3:22 PM Corelaton and Regression | GeeksforGeeks
* (1,0)
* (2,0)
° (3,1)
* (4,1)
(5,1)
Solution:
The logistic regression model is:
log (%) =a+6Xx
Using a statistical software or calculation tool, we can determine:
So, the equation becomes:
log (%) 3411X
For X = 4:
log (385) -3411x4=14
Solving for p:
Ba elt
Tee
4.055
pe hii, = 0.802
So, the probability of Y being 1 for X = 4 is approximately 0.802, or
80.2%.
Conclusion
Correlation and regression are powerful tools for understanding and
predicting relationships between variables. While correlation helps us
understand the direction and strength of a relationship, regression allows
us to model and make predictions based on that relationship. By applying
these techniques correctly and understanding their assumptions, you can
unlock valuable insights from your data.
ntps:www geekstorgecks orgicorelaion-and-regression ans1512125, 3:22 PM Correlation and Regression | GesksforGeeks
Read More,
inear Regression Formula
* Correlation Coefficient Formula
conent | [sori [srs wthus Next Article
Multiplication Worksheets
Si
ilar Reads
Correlation: Meaning, Significance, Types and Degree of Correlation
The previous statistical approaches (such as central tendency and
dispersion) are limited to analysing a single variable or statistical analysis...
15+ min read
Real-Life Applications of Correlation and Regression
Correlation and regression analysis represent useful discrimination and
classification tools in statistics which find applications in different fields and...
15+ min read
Covariance and Correlation
Covariance and correlation are the two key concepts in Statistics that help us
analyze the relationship between two variables. Covariance measures how.
15+ min read
What is Correlation Analysis?
Most of the data in the world is interrelated by various factors. Data Science
deals with understanding the relationships between different variables. Thi...
15+ min read
ntps:wwn.geekstorgecks orgicorelaion-and-regression ons192/25, 2:22PM Correlation and Reg
Linear Regression Formula
ssn | GacksforGooks,
Linear regression is a statistical method that is used in various machine
learning models to predict the value of unknown data using other related...
15+ min read
Regression vs ANOVA
ANOVA and Regression have distinct objectives. Whereas regression
employs a binary response variable to predict the category, ANOVA...
15+ min read
Mean, Variance and Standard Deviation
Mean, Variance and Standard Deviation are fundamental concepts in
statistics and engineering mathematics, essential for analyzing and...
15+ min read
Quartile Deviation and Coefficient of Quartile Deviation: Meaning,...
The extent to which the values of a distribution differ from the average of
that distribution is known as Dispersion. The measures of dispersion can be.
15+ min read
How to Calculate Expected Value in R?
In this article, we are going to see how to calculate the excepted value using
R Programming Language. A probability distribution describes all the...
Tmin read
Bayes’ Theorem in Data Mining
Bayes' Theorem describes the probability of an event, based on precedent
knowledge of conditions which might be related to the event. In other word...
15+ min read
ritps www. geeksforgeeks.orglcortelaton-and-egression! sons1512125, 3:22 PM Correlation and Regression | GesksforGeeks
OG GegksforGeeks
Tower, Sector- 136, Noida, Uttar Pradesh
(201305)
Registered Address:
K 061, Tower k, Gulshan Vivante
Apartment, Sector 137, Noida, Gautam
Buddh Nagar, Uttar Pradesh, 201305
Advertise with us
Company Explore
About Us Job-A-Thon Hiring Challenge
Legal FG Weekly Contest
Privacy Policy Offline Classroom Program
Careers DSA in JAVAICH
InMedia
Contact Us
646 Corporate Solution
Placement Training Program
Languages
Python
Java
cr
PHP
Golang
sol
RLanguage
Android Tutorial
Data Science & ML
Data Science With Python
Data Sciencé
9 Beginner
ntps:www geekstorgecks orgicorelaion-and-regression
Master System Design
Master CP
GeeksforGeeks Videos
DSA
Data Structures
Algorithms
DSA for Beginners
Basic DSA Problems
DSA Roadmap
DSA interview Questions
Competitive Programming,
Web Technologies
HTM
css
ssCorrelation and Regression | GesksforGeeks
1512125, 3:22 PM
Machine Learning
ML Maths
Data Visualisation
Pandas
NumPy
NLP
Deep Learning.
Python Tutorial
Python Programming Examples
Django Tutorial
Python Projects
Python Tkinter
Web Scraping
Opency Tutorial
Python Interview Question
DevOps
sit
AWS
Docker
Kubernetes
Azure
cP
Devops Roadmap
‘School Subjects
Mathematics
Physics
Chemistry
Biology
Social Science
English Grammar
Preparation Corner
Company-Wise Recruitment Process
Aptitude Preparation
Puzzles
‘Company-Wise Preparation
Machine Learning/Data Science
Complete Machine Learning & Data Science Program - [LIVE]
ntps:www geekstorgecks orgicorelaion-and-regression
JavaScript
Typescript
Reacts
Nexus
Nodes
Bootstrap
Tallwind CSS
Computer Science
GATE CS Notes
Operating Systems
Computer Network
Database Manageme
Software Engineering
Digital Logic Design
Engineering Maths
System
system Design
High Level Design
Low Level Design
UML Diagrams
Interview Guide
Design Patterns
‘00AD
System Design Bootcamp
Interview Questions
Databases
sq
MysQt
PostgreSQL
PL/SQL,
MongoDB
More Tutorials
Software Development
Software Testing
Product Management
Project Management
Linux
Excel
AllCheat Sheets
Programming Languages
Programming with Data Structures
rans1512125, 3:22 PM Correlation and Regression | GesksforGeeks
Data Analytics Training using Excel, SQL, Python & PowerB!- cH Programming Course
[uve] Java Programming Course
Data Science Training Program -[LIVE Python Full Course
Data Science Course with IBM Certification
Clouds/Devops GATE 2026
DevOps Engineering GATE CS Rank Booster
AWS Solutions Architect Certification GATE DA Rank Booster
Salesforce Certified Administrator Course GATE CS & IT Course - 2026
GATE DA Course 2026
GATE Rank Predictor
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
ntps:www geekstorgecks orgicorelaion-and-regression
1313