VOOZH about

URL: https://www.geeksforgeeks.org/r-language/perform-linear-regression-analysis-in-r-programming-lm-function/

⇱ Perform Linear Regression Analysis in R Programming - lm() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Perform Linear Regression Analysis in R Programming - lm() Function

Last Updated : 15 Jul, 2025
lm() function in R Language is a linear model function, used for linear regression analysis.
Syntax: lm(formula) Parameters: formula: model description, such as x ~ y
Example 1: Output:
Call:
lm(formula = x ~ y)

Coefficients:
(Intercept) y 
 1.589e-15 5.000e-01 
Example 2: Output:
Call:
lm(formula = y ~ x)

Coefficients:
(Intercept) x 
 -1 1 
Comment
Article Tags:

Explore