In: Statistics and Probability
11.29) A builder wants to predict the relationship between house size (as measured by number of rooms). and selling price. Two difference neighbourhoods are compare. A random sample of 215 houses is selected, with the results as follows.
House | Number of rooms | Selling Price ($000) | Neighbourhood |
1 | 8 | 345 | 0 |
2 | 8 | 360 | 1 |
3 | 6 | 325 | 0 |
4 | 8 | 400 | 1 |
5 | 7 | 350 | 1 |
6 | 9 | 360 | 0 |
7 | 13 | 405 | 0 |
8 | 6 | 299 | 0 |
9 | 8 | 405 | 1 |
10 | 9 | 365 | 0 |
11 | 10 | 520 | 1 |
12 | 8 | 330 | 0 |
13 | 14 | 600 | 1 |
14 | 9 | 370 | 0 |
15 | 7 | 395 | 1 |
(a) Is there a relationship between selling price and two
independent variables at the 0.05 level of significance?
(b) Does the independent variable make a contribution to the
regression model?
(c) Add an interaction term to the model and at the 0.05 level of
significance determine whether it makes a significant contribution
to the model.0
Solution:
(a) Is there a relationship between selling price and two independent variables at the 0.05 level of significance?
Accessing relationship between Selling price and Number of rooms :
r = correlation coefficient = 0.7679632
critical correlation coefficient at the 0.05 level of significance (n = 15) = 0.514
Since r > 0.514, there is significant linear relation ship between Selling price and Number of rooms
Accessing relationship between Selling price and neighbourhood :
r = correlation coefficient = 0.55288
critical correlation coefficient at the 0.05 level of significance (n = 15) = 0.514
Since r > 0.514, there is significant linear relation ship between Selling price and neighbourhood
b ) Does the independent variable make a contribution to the regression model?
Fro the regression model
selling_price ~ number_of_rooms + neighbourhood
Coefficients: |
Estimate Std. Error t value Pr(>|t|) |
(Intercept) 137.504 36.754 3.741 0.00282 ** |
number_of_rooms 24.985 4.081 6.122 5.16e-05 *** |
neighbourhood 74.059 17.839 4.152 0.00134 ** |
The p value of the coefficients of the independent variables in the regression model is < 0.05
Therefore independent variable make a significant contribution to the regression model.
(c) Add an interaction term to the model and at the 0.05 level of significance determine whether it makes a significant contribution to the model.
After adding the interaction term in the model , the regression equation becomes
selling_price ~ number_of_rooms + neighbourhood + neighbourhood * number_of_rooms
Coefficients: |
Estimate Std. Error t value Pr(>|t|) |
(Intercept) 231.750 35.398 6.547 4.15e-05 *** |
number_of_rooms 13.897 4.047 3.434 0.00558 ** |
neighbourhood -110.781 50.178 -2.208 0.04941 * |
number_of_rooms:neighbourhood 21.316 5.611 3.799 0.00295 ** |
The p value of the coefficient of the interaction variable (number_of_rooms*neighbourhood ) is 0.00295 << 0.05 significance level, Therefore this interaction term makes a significant contribution to the model