x | y |
1460 | 288700 |
2108 |
309300 |
1743 |
301400 |
1499 |
291100 |
1864 |
302400 |
2391 |
314900 |
1977 |
305400 |
1610 |
297000 |
1530 |
292400 |
1759 |
298200 |
1821 |
304300 |
2216 |
311700 |
If you try to rent an apartment or buy a house, you find that real estate representatives establish apartment rents and house prices (Y) on the basis of the square footage of heated floor space (X). The data in EX1239 give the square footages and sales prices of n = 12 houses randomly selected from those sold in a small city.
a. What is the least-squares prediction equation?
b. Should the independent variable remain in the equation? Why or why not?
c. Using the original model, how good is it? Give a quantitative answer and then explain your answer in a way that a non-statistician could understand.
d. Assume square footage of 2000. What is your estimation of the price?
Simple Linear Regression Models is given by
y = β0 +β1x+ε
y= house prices
x=quare footage of heated floor space
β0 is the y-intercept of the regression line.
β1 is the slope.
The Least-squares prediction Equation is
(ŷ) = β0 +β1x
i have calculated all these value by using r software
i will provide the r codes and answer
data=read.csv(file.choose())
> data
x y
1 1460 288700
2 2108 309300
3 1743 301400
4 1499 291100
5 1864 302400
6 2391 314900
7 1977 305400
8 1610 297000
9 1530 292400
10 1759 298200
11 1821 304300
12 2216 311700
x=data$x
> x
[1] 1460 2108 1743 1499 1864 2391 1977 1610 1530 1759 1821
2216
> y=data$y
> y
[1] 288700 309300 301400 291100 302400 314900 305400 297000 292400
298200 304300 311700
>
model=lm(y~x)
> model
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
251206.37 27.41
> summary(model)
Call:
lm(formula = y ~ x)
Residuals:
Min 1Q Median 3Q Max
-2518.8 -1194.0 -112.5 659.3 3187.8
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.512e+05 3.389e+03 74.13 4.87e-15 ***
x 2.741e+01 1.828e+00 14.99 3.52e-08 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’
1
Residual standard error: 1793 on 10 degrees of
freedom
Multiple R-squared: 0.9574, Adjusted R-squared: 0.9531
F-statistic: 224.7 on 1 and 10 DF, p-value: 3.522e-08
from the above model the
β0 is the y-intercept of the regression line = 251206.37
β1 is the slope = 27.41
The Least-squares prediction Equation is
(ŷ) = β0 +β1x
(ŷ)=251206.37 + 27.41 *x
independent variable remain in the equation is not same becouse the value of β0 and β1 are positive
if value of β0 and β1 are zero then only the valye of y remain same but in our model the value of β0 and β1
are not zero then the value of y is not remain same they will vary
original model is is very good fit for the above data becousw the value of R-squared: 0.9574
means the 95% given model is good only 5% chanses to model is rejected
the 95.74 % amount variationof y is explained by the x
If the square footage is 2000 then the estimation of the price is given by
(ŷ)=251206.37 + 27.41 *x
x=2000
ŷ=251206.37 + 27.41 *2000
> ŷ
[1] 306026.4
he square footage is 2000 then the estimation of the price is 306026.4
x y 1460 288700 2108 309300 1743 301400 1499 291100 1864 302400 2391 314900 1977 305400...