Pearson Correlation and Linear Regression (2024)

A correlation or simple linear regression analysis can determine if two numeric variables are significantly linearly related. A correlation analysis provides information on the strength and direction of the linear relationship between two variables, while a simple linear regression analysis estimates parameters in a linear equation that can be used to predict values of one variable based on the other.

Correlation

The Pearson correlation coefficient, r, can take on values between -1 and 1. The further away ris from zero, the stronger the linear relationship between the two variables. The sign of rcorresponds to the direction of the relationship. If ris positive, then as one variable increases, the other tends to increase. Ifris negative, then as one variable increases, the other tends to decrease. A perfect linear relationship (r=-1 orr=1) means that one of the variables can be perfectly explained by a linear function of the other.

Examples:

Linear Regression

A linear regression analysis produces estimates for the slope and interceptof the linear equation predicting an outcome variable, Y, based on values of a predictor variable, X. A general form of this equation is shown below:

The intercept, b0, is the predicted value of Y when X=0. The slope, b1, is the average change in Y for every one unit increase in X. Beyond giving you the strength and direction of the linear relationship between X and Y, the slope estimate allows an interpretation for how Y changes when X increases. This equation can also be used to predict values of Y for a value ofX.

Examples:

Inference

Inferential tests can be run on both the correlation and slope estimates calculated from a random sample from a population. Both analyses are t-tests run on the null hypothesis that the two variables are not linearly related. If run on the same data, a correlation test and slope test provide the same test statistic and p-value.

Assumptions:

  • Random samples
  • Independent observations
  • The predictor variable and outcome variable are linearly related (assessed by visually checking a scatterplot).
  • The population of values for the outcome arenormally distributed for each value of the predictor (assessed by confirming the normality of the residuals).
  • The variance of the distribution of the outcome is the same for all values of the predictor (assessed by visually checking a residual plot for a funneling pattern).

Hypotheses:

Ho: The two variables are not linearly related.
Ha: The two variables are linearly related.

Relevant Equations:

Degrees of freedom: df = n-2

Example 1: Hand calculation

These videos investigate the linear relationship between people’s heights and arm span measurements.

Correlation:

Pearson Correlation and Linear Regression (9)

Pearson Correlation and Linear Regression (10)

Regression:

Pearson Correlation and Linear Regression (11)

Pearson Correlation and Linear Regression (12)

Sample conclusion: Investigating the relationship between armspan and height, we find a largepositive correlation (r=.95), indicating a strong positive linear relationship between the two variables. We calculated the equation for the line of best fit as Armspan=-1.27+1.01(Height). This indicates that for a person who is zero inches tall, their predicted armspan would be -1.27 inches. This is not a possible value as the range of our data will fall much higher. For every 1 inch increase in height, armspan is predicted to increase by 1.01 inches.

Example 2: Performing analysis in Excel 2016 on
Some of this analysis requires you to have the add-in Data Analysis ToolPak in Excel enabled.

Dataset used in videos

Correlation matrix and p-value:
PDF directions corresponding to video

Pearson Correlation and Linear Regression (13)

Pearson Correlation and Linear Regression (14)

Creating scatterplots:
PDF directions corresponding to video

Pearson Correlation and Linear Regression (15)

Pearson Correlation and Linear Regression (16)

Linear model (first half of tutorial):
PDF directions corresponding to video

Pearson Correlation and Linear Regression (17)

Pearson Correlation and Linear Regression (18)

Creating residual plots:
PDF directions corresponding to video

Pearson Correlation and Linear Regression (19)

Pearson Correlation and Linear Regression (20)

Sample conclusion: In evaluating the relationship between how happy someone is and how funny others rated them, the scatterplot indicates that there appears to be a moderately strong positive linear relationship between the two variables, which is supported by the correlation coefficient (r = .65). A check of the assumptions using the residual plot did not indicate any problems with the data. The linear equation for predicting happy from funny was Happy=.04+0.46(Funny). The y-intercept indicates that for a person whose funny rating was zero, their happiness is predicted to be .04. Funny rating does significantly predict happiness such that for every 1 point increase in funny rating the males are predicted to increase by .46 in happiness (t = 3.70, p = .002).

Example 3: Performing analysis in R

The following videos investigate the relationship between BMI and blood pressure for a sample of medical patients.

Dataset used in videos

Correlation:
R script file used in video

Pearson Correlation and Linear Regression (21)

Pearson Correlation and Linear Regression (22)

Regression:
R script file used in video

Pearson Correlation and Linear Regression (23)

Pearson Correlation and Linear Regression (24)

Pearson Correlation and Linear Regression (2024)
Top Articles
F5 History: Founding, Timeline, and Milestones - Zippia
Which type of muscle has myogenic activity? I. Cardiac muscle II. Skeletal muscle III. Smooth muscle
Somboun Asian Market
Cold Air Intake - High-flow, Roto-mold Tube - TOYOTA TACOMA V6-4.0
Ffxiv Shelfeye Reaver
Craftsman M230 Lawn Mower Oil Change
Wisconsin Women's Volleyball Team Leaked Pictures
Cad Calls Meriden Ct
Wmu Course Offerings
Top Financial Advisors in the U.S.
Corpse Bride Soap2Day
Optum Medicare Support
Pbr Wisconsin Baseball
Espn Expert Picks Week 2
454 Cu In Liters
4156303136
Painting Jobs Craigslist
Kamzz Llc
EASYfelt Plafondeiland
Japanese Mushrooms: 10 Popular Varieties and Simple Recipes - Japan Travel Guide MATCHA
At&T Outage Today 2022 Map
Jordan Poyer Wiki
kvoa.com | News 4 Tucson
Cornedbeefapproved
Aes Salt Lake City Showdown
Stockton (California) – Travel guide at Wikivoyage
Kelley Fliehler Wikipedia
Willys Pickup For Sale Craigslist
County Cricket Championship, day one - scores, radio commentary & live text
Otis Offender Michigan
Stolen Touches Neva Altaj Read Online Free
Www Craigslist Com Shreveport Louisiana
How to Watch the X Trilogy Starring Mia Goth in Chronological Order
Seymour Johnson AFB | MilitaryINSTALLATIONS
Junee Warehouse | Imamother
Tds Wifi Outage
Elgin Il Building Department
Hindilinks4U Bollywood Action Movies
Ticket To Paradise Showtimes Near Marshall 6 Theatre
Pokemon Reborn Locations
Craigslist Tulsa Ok Farm And Garden
Cranston Sewer Tax
412Doctors
Timothy Warren Cobb Obituary
Professors Helpers Abbreviation
Dontrell Nelson - 2016 - Football - University of Memphis Athletics
Copd Active Learning Template
Bonecrusher Upgrade Rs3
The 13 best home gym equipment and machines of 2023
Kidcheck Login
Guidance | GreenStar™ 3 2630 Display
Latest Posts
Article information

Author: Greg Kuvalis

Last Updated:

Views: 6532

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Greg Kuvalis

Birthday: 1996-12-20

Address: 53157 Trantow Inlet, Townemouth, FL 92564-0267

Phone: +68218650356656

Job: IT Representative

Hobby: Knitting, Amateur radio, Skiing, Running, Mountain biking, Slacklining, Electronics

Introduction: My name is Greg Kuvalis, I am a witty, spotless, beautiful, charming, delightful, thankful, beautiful person who loves writing and wants to share my knowledge and understanding with you.