Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9181151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:13:08+00:00 2026-06-17T18:13:08+00:00

I am using lm in r for linear regression. I would like to plot

  • 0

I am using lm in r for linear regression. I would like to plot and report the x intercept. I know that I could use algebra and solve for x by setting y = 0, but is there a way to have r report it to me? Also, how can I ‘tell’ r to plot the x intercept? Would this just entail extending the x axis range to include it? Thanks.

# example r code
plot(y~x)
fit <- lm(y~x)
abline(fit)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:13:09+00:00Added an answer on June 17, 2026 at 6:13 pm

    If you want to plot the x-intercept, extend the plot as you said. You might need to extend it in both the x and y dimensions (use xlim=c(0,100) and ylim=c(0,100) or whatever), and you should note that R does not plot lines for the axes. I supposed you can add them in manually with hline and vline if you want.

    To get the numerical value of the x-intercept, you’ll have to do algebra.

    > coef(fit)
    (Intercept)           x 
      0.8671534   0.4095524 
    

    Gives the y-intercept and the slope, and you can easily find the x-intercept from there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I plot a simple linear regression using R. I would like to save that
Using R, I would like to plot a linear relationship between two variables, but
I need to use Regression (Linear) in my application for that i am using
I would like to solve the system of linear equations: Ax = b A
I am trying to run a simple linear regression (using rpy2 from Python) and
I am training linear regression model using a data-set which has real valued labels
Classification and regression trees by Breiman et al mentioned about using linear combination of
I've been using eigen3 linear algebra library in c++ for a while, and I've
I am using xmaxima to solve two simultaneous non-linear equations using the 'solve' command.The
I want to solve a system of n linear equations containing n variables using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.