# Regression line - R Summary(lm…)) calculates the estimate & slope( beta0 & beta1) of what?

Hi I have a question concerning R, statistics, regression and Summary(lm(....))

When using R and the summary(lm(..)) function I get an output like that:

I pretty much know what each of the numbers means but it is not clear for me what the estimate and std Error are calculated from.

When I plot a plot like that

I have 32 (x/y)-Datapoints. Now I fit a linear model and get a beta0 as well as an beta1. What exactly are beta0 and beta1 calculated from ?

• the residuals ? ( do I get 32 distances from where I calculate the estimate+ StdError ?)
• the slope ? ( do I get the first point, fit a line through this point-> get one beta1, take the second point and fit a line through these 2 pts -> get another beta1,... Then I take the Estimate + StdError of 32 beta1s ?)

## migrated from stackoverflow.comOct 25 '17 at 2:41

This question came from our site for professional and enthusiast programmers.

• It sounds like you need some basic background information. I would start here, here, here, and here. The first three are clearly written, beginner-level pieces on understanding output from R's lm()` and plotting, while the last one is the Wikipedia on how you estimate OLS coefficients. – duckmayr Oct 24 '17 at 19:28
• It sounds like you aren't really asking a programming question as much as a statistics question. I think you just need to read up on how to fit a multiple linear regression. – Dason Oct 24 '17 at 19:51