Simple Linear Regression (2024)

Introduction

Regression analysis is commonly used for modeling the relationship between a single dependent variable Y and one or more predictors. When we have one predictor, we call this "simple" linear regression:

E[Y] = β0 + β1X

That is, the expected value of Y is a straight-line function of X. The betas are selected by choosing the line that minimizing the squared distance between each Y value and the line of best fit. The betas are chose such that they minimize this expression:

i (yi – (β0 + β1X))2

An instructive graphic I found on the Internet

Simple Linear Regression (1)

Source: http://www.unc.edu/~nielsen/soci709/m1/m1005.gif

When we have more than one predictor, we call it multiple linear regression:

Y = β0 + β1X1+ β2X2+ β2X3+… + βkXk

The fitted values (i.e., the predicted values) are defined as those values of Y that are generated if we plug our X values into our fitted model.

The residuals are the fitted values minus the actual observed values of Y.

Here is an example of a linear regression with two predictors and one outcome:

Instead of the "line of best fit," there is a "plane of best fit."

Simple Linear Regression (2)

Source: James et al. Introduction to Statistical Learning (Springer 2013)

There are four assumptions associated with a linear regression model:

  1. Linearity: The relationship between X and the mean of Y is linear.
  2. hom*oscedasticity: The variance of residual is the same for any value of X.
  3. Independence: Observations are independent of each other.
  4. Normality: For any fixed value of X, Y is normally distributed.

We will review how to assess these assumptions later in the module.

Let's start with simple regression. In R, models are typically fitted by calling a model-fitting function, in our case lm(), with a "formula" object describing the model and a "data.frame" object containing the variables used in the formula. A typical call may look like

> myfunction <- lm(formula, data, …)

and it will return a fitted model object, here stored as myfunction. This fitted model can then be subsequently printed, summarized, or visualized; moreover, the fitted values and residuals can be extracted, and we can make predictions on new data (values of X) computed using functions such as summary(), residuals(),predict(), etc. Next, we will look at how to fit a simple linear regression.


return to top | previous page | next page

Simple Linear Regression (2024)

FAQs

Simple Linear Regression? ›

Definition. Simple linear regression aims to find a linear relationship to describe the correlation between an independent and possibly dependent variable. The regression line can be used to predict or estimate missing values, this is known as interpolation.

How do you explain linear regression in simple terms? ›

Linear regression is a data analysis technique that predicts the value of unknown data by using another related and known data value. It mathematically models the unknown or dependent variable and the known or independent variable as a linear equation.

What is the difference between simple and multiple linear regression? ›

Simple linear regression has only one x and one y variable. Multiple linear regression has one y and two or more x variables.

What is a simple linear regression real life example? ›

A simple linear regression real life example could mean you finding a relationship between the revenue and temperature, with a sample size for revenue as the dependent variable. In case of multiple variable regression, you can find the relationship between temperature, pricing and number of workers to the revenue.

Is simple linear regression the same as correlation? ›

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.

How to explain regression in layman terms? ›

Regression — as fancy as it sounds can be thought of as “relationship” between any two things. For example, imagine you stay on the ground and the temperature is 70°F. You start climbing a hill and as you climb, you realize that you are feeling colder and the temperature is dropping.

How to interpret simple linear regression? ›

It is interpreted as the proportion of observed y variation that can be explained by the simple linear regression model (attributed to an approximate linear relationship between y and x). The higher the value of r2, the more successful is the simple linear regression model in explaining y variation.

What is the difference between simple linear regression and linear regression? ›

Linear regression shows the linear relationship between the independent(predictor) variable i.e. X-axis and the dependent (output) variable i.e. Y-axis, called linear regression. If there is a single input variable X (independent variable), such linear regression is simple linear regression.

Should I use linear regression or multiple regression? ›

MLR is a statistical tool used to predict the outcome of a variable based on two or more explanatory variables. If just one variable affects the dependent variable, a simple linear regression model is sufficient. If, on the other hand, more than one thing affects that variable, MLR is needed.

When to use linear regression? ›

You can use linear regression when you want to predict a continuous dependent variable from a scale of values. Use logistic regression when you expect a binary outcome (for example, yes or no). Here are examples of linear regression: Predicting the height of an adult based on the mother's and father's height.

Why use a simple linear regression? ›

Simple linear regression aims to find a linear relationship to describe the correlation between an independent and possibly dependent variable. The regression line can be used to predict or estimate missing values, this is known as interpolation.

What is a good example of linear regression? ›

We could use the equation to predict weight if we knew an individual's height. In this example, if an individual was 70 inches tall, we would predict his weight to be: Weight = 80 + 2 x (70) = 220 lbs. In this simple linear regression, we are examining the impact of one independent variable on the outcome.

What is the situation where you would use simple linear regression? ›

Simple linear regression is used to estimate the relationship between two quantitative variables. You can use simple linear regression when you want to know: How strong the relationship is between two variables (e.g., the relationship between rainfall and soil erosion).

What is the main problem with using single regression line? ›

Answer: The main problem with using single regression line is it is limited to Single/Linear Relationships. linear regression only models relationships between dependent and independent variables that are linear. It assumes there is a straight-line relationship between them which is incorrect sometimes.

What is another name for simple linear regression? ›

Linear regression is the most common form of this technique. Also called simple regression or ordinary least squares (OLS), linear regression establishes the linear relationship between two variables.

Why use regression instead of correlation? ›

Correlation is almost always used when you measure both variables. It rarely is appropriate when one variable is something you experimentally manipulate. Linear regression is usually used when X is a variably you manipulate (time, concentration, etc.)

Top Articles
The Best mobile Games: Which Ones to Play
Work Life Philosophy
UPS Paketshop: Filialen & Standorte
Unit 30 Quiz: Idioms And Pronunciation
Caesars Rewards Loyalty Program Review [Previously Total Rewards]
Lexington Herald-Leader from Lexington, Kentucky
The Potter Enterprise from Coudersport, Pennsylvania
Retro Ride Teardrop
Craigslist - Pets for Sale or Adoption in Zeeland, MI
Western Razor David Angelo Net Worth
Heska Ulite
Spelunking The Den Wow
Ukraine-Russia war: Latest updates
Audrey Boustani Age
Insidekp.kp.org Hrconnect
Hoe kom ik bij mijn medische gegevens van de huisarts? - HKN Huisartsen
Saberhealth Time Track
Hell's Kitchen Valley Center Photos Menu
Enterprise Car Sales Jacksonville Used Cars
Bitlife Tyrone's
Blackwolf Run Pro Shop
Gem City Surgeons Miami Valley South
Unterwegs im autonomen Freightliner Cascadia: Finger weg, jetzt fahre ich!
Uconn Health Outlook
[PDF] PDF - Education Update - Free Download PDF
Crossword Help - Find Missing Letters & Solve Clues
Cpt 90677 Reimbursem*nt 2023
Kirk Franklin Mother Debra Jones Age
Malluvilla In Malayalam Movies Download
Craigslist Northern Minnesota
Orange Park Dog Racing Results
Babydepot Registry
Planned re-opening of Interchange welcomed - but questions still remain
Bursar.okstate.edu
Have you seen this child? Caroline Victoria Teague
Miss America Voy Board
Greater Keene Men's Softball
Woodman's Carpentersville Gas Price
Linda Sublette Actress
R/Moissanite
craigslist: modesto jobs, apartments, for sale, services, community, and events
Windshield Repair & Auto Glass Replacement in Texas| Safelite
[Teen Titans] Starfire In Heat - Chapter 1 - Umbrelloid - Teen Titans
Suntory Yamazaki 18 Jahre | Whisky.de » Zum Online-Shop
Arch Aplin Iii Felony
Dlnet Deltanet
Okta Login Nordstrom
Every Type of Sentinel in the Marvel Universe
St Als Elm Clinic
Wera13X
David Turner Evangelist Net Worth
Latest Posts
Article information

Author: Velia Krajcik

Last Updated:

Views: 6105

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Velia Krajcik

Birthday: 1996-07-27

Address: 520 Balistreri Mount, South Armand, OR 60528

Phone: +466880739437

Job: Future Retail Associate

Hobby: Polo, Scouting, Worldbuilding, Cosplaying, Photography, Rowing, Nordic skating

Introduction: My name is Velia Krajcik, I am a handsome, clean, lucky, gleaming, magnificent, proud, glorious person who loves writing and wants to share my knowledge and understanding with you.