What is the difference between Pearson R and Simple Linear Regression? (2024)

What is the difference between Pearson R and Simple Linear Regression?

In “simple linear regression” (ordinary least-squares regression with 1 variable), you fit a line

ŷ = a + b * x

in the attempt to predict the target variable y using the predictor x.

Let’s consider a simple example to illustrate how this is related to the linear correlation coefficient, a measure of how two variables are linearly related (or vary together).

x = [1.0, 1.8, 3.0, 3.7]
y = [0.5, 2.0, 3.0, 3.9]

What is the difference between Pearson R and Simple Linear Regression? (1)

Linear correlation between variables

The Pearson correlation coefficient is computed as:

What is the difference between Pearson R and Simple Linear Regression? (2)

As we can see, the correlation coefficient is just the covariance (cov) between 2 features x and y “standardized” by their standard deviations (σ), where

the standard deviation is computed as

What is the difference between Pearson R and Simple Linear Regression? (3)

Similarly, the covariance is computed as

What is the difference between Pearson R and Simple Linear Regression? (4)

In our simple example above, we get

  • cov(x, y) ≈ 1.3012
  • σ_x ≈ 1.0449
  • σ_y ≈ 1.2620
  • r = 0.9868

Simple Linear Regression

Now, for simple linear regression, we compute the slope as follows:

What is the difference between Pearson R and Simple Linear Regression? (5)

To show how the correlation coefficient r factors in, let’s rewrite it as

What is the difference between Pearson R and Simple Linear Regression? (6)

where the first term is equal to r, which we defined earlier; we can now see that we could use the “linear correlation coefficient” to compute the slope of the line as

What is the difference between Pearson R and Simple Linear Regression? (7)

Continuing with the example from above, we get b ≈ 0.8171.

So, essentially, the linear correlation coefficient (Pearson’s r) is just the standardized slope of a simple linear regression line (fit).
To continue with the example, we can now compute the y-axis intercept as

What is the difference between Pearson R and Simple Linear Regression? (8)

a ≈ 0.4298

Now, our linear regression fit would be

ŷ = 0.4298 + 0.8171 * x

What is the difference between Pearson R and Simple Linear Regression? (9)

Standardizing Variables

In practice, we often standardize our input variables:

What is the difference between Pearson R and Simple Linear Regression? (10)

After standardization, our variables have the properties of a standard normal distribution with mean=0, andstandard deviation 1.

What is the difference between Pearson R and Simple Linear Regression? (11)

Or in other words, we center our variables at 0 so that we don’t need to compute the y-axis intercept.

ŷ = a * x = r * x

This is also useful if we use optimization algorithms for multiple linear regression, such as gradient descent, instead of the closed-form solution (handy for working with large datasets). Here, we want to standardize the variables so that the gradient descent learning algorithms learns the model coefficients “equally” in multiple linear regression.Another advantage of this approach is that the slope is then exactly the same as the correlation coefficient, which saves another computational step.

ŷ = a * x = r * x = a * 0.9868

What is the difference between Pearson R and Simple Linear Regression? (12)

If you like this content and you are looking for similar, more polished Q & A’s, check out my new book Machine Learning Q and AI.

What is the difference between Pearson R and Simple Linear Regression? (2024)
Top Articles
Transferring Parent PLUS Loans to Student Through Refinancing | Credible
Why You Shouldn't Leave a Wart Untreated - Northstar Dermatology
Aberration Surface Entrances
Craigslist Niles Ohio
Craigslist Cars And Trucks For Sale By Owner Indianapolis
Craigslist Benton Harbor Michigan
Retro Ride Teardrop
Mikayla Campinos Videos: A Deep Dive Into The Rising Star
What is the surrender charge on life insurance?
R/Afkarena
Studentvue Columbia Heights
DoorDash, Inc. (DASH) Stock Price, Quote & News - Stock Analysis
What is Rumba and How to Dance the Rumba Basic — Duet Dance Studio Chicago | Ballroom Dance in Chicago
Amc Flight Schedule
Echat Fr Review Pc Retailer In Qatar Prestige Pc Providers – Alpha Marine Group
St. Petersburg, FL - Bombay. Meet Malia a Pet for Adoption - AdoptaPet.com
MLB power rankings: Red-hot Chicago Cubs power into September, NL wild-card race
Self-Service ATMs: Accessibility, Limits, & Features
Talk To Me Showtimes Near Marcus Valley Grand Cinema
Hdmovie2 Sbs
Aspenx2 Newburyport
27 Modern Dining Room Ideas You'll Want to Try ASAP
1773x / >
Nottingham Forest News Now
Phoenixdabarbie
Boneyard Barbers
Panchang 2022 Usa
Movies123.Pick
SOC 100 ONL Syllabus
Babylon 2022 Showtimes Near Cinemark Downey And Xd
Bella Thorne Bikini Uncensored
Devotion Showtimes Near The Grand 16 - Pier Park
Trivago Myrtle Beach Hotels
Myanswers Com Abc Resources
Paperless Employee/Kiewit Pay Statements
Cpmc Mission Bernal Campus & Orthopedic Institute Photos
Cnp Tx Venmo
Differential Diagnosis
Dragon Ball Super Super Hero 123Movies
Parent Portal Pat Med
Coffee County Tag Office Douglas Ga
Sara Carter Fox News Photos
Syrie Funeral Home Obituary
Leland Westerlund
Dobratz Hantge Funeral Chapel Obituaries
Erica Mena Net Worth Forbes
Walmart Front Door Wreaths
Wild Fork Foods Login
Gear Bicycle Sales Butler Pa
Image Mate Orange County
Where To Find Mega Ring In Pokemon Radical Red
When Is The First Cold Front In Florida 2022
Latest Posts
Article information

Author: Gregorio Kreiger

Last Updated:

Views: 6787

Rating: 4.7 / 5 (77 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Gregorio Kreiger

Birthday: 1994-12-18

Address: 89212 Tracey Ramp, Sunside, MT 08453-0951

Phone: +9014805370218

Job: Customer Designer

Hobby: Mountain biking, Orienteering, Hiking, Sewing, Backpacking, Mushroom hunting, Backpacking

Introduction: My name is Gregorio Kreiger, I am a tender, brainy, enthusiastic, combative, agreeable, gentle, gentle person who loves writing and wants to share my knowledge and understanding with you.