# Need help reading the code please to calculate the least squares regression

#### moutazgendia

##### New Member
Hello I am new to statistics and I am not familiar with the R lab. I was trying to solve to calculate the least squares regression and I am not able to understand the code below. Can you help me please

Construct the least squares regression line based in the following output:

Call:

lm(formula = egg_production ~ age, data = chickendata)

Coefficients:

Estimate Std. Error t value Pr(>|t|)

(Intercept) 3.24521 .981048 0.342 0.831

age -0.34231 0.03453 2.874 0.0020 **

---

Signif. codes: 0 ‘***’0.001 ‘**’0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ‘ 1

Correlation Matrix:

egg_production age

egg_production 1.0000000 0.6213532

age 0.6213532 1.0000000

Please, structure your response as y = _ + _x so, for example, if the value of b0 was 1.3 and the value of b1 was 0.42, then your answer would be: y = 1.3 + 0.42x. Please round to the third decimal place.

#### hlsmith

##### Less is more. Stay pure. Stay poor.
Well if I said Intercept = b0 and age = b1, what would you write out?

#### moutazgendia

##### New Member
I would write;
b0= 3.24521
age= 0.03453
y= 3.24521 + 0.0345X

is that right?

#### hlsmith

##### Less is more. Stay pure. Stay poor.
No, the instruction s say round to 3rd decimal and were there any negative signs in the model output?

#### Dason

And 0.3 is different than .03

#### hlsmith

##### Less is more. Stay pure. Stay poor.
Hot mess for sure!

#### moutazgendia

##### New Member
So it should be
y= 3.245 - 0.342X ?