Professional Documents
Culture Documents
PATNA
Where price is the house price measured in thousands of dollars, sqrft is the square foot area of
the house, bdrms is the number of bedrooms in the house and e stands for the random error.
Ans-
First the Directory has been set through setwd and getwd.
Then Data has been attached by 3rd and 4th commands.
Then model has been created by 5th command.
price = Dependent
sqrft = Independent
bdrms = Independent
B0 = Intercept
B1 = Slope
B2 = Slope
Ans- In question it is asked the estimated increase in price for a house with one more bedroom,
holding square footage constant. Where price is measured in thousands of dollars, so one bedroom is
estimated to increase the house price by 15.20*1= 15.2 or $15200(15.2*1000)
(iii) What is the estimated increase in price for a house with an additional bedroom that is 140 square
feet in size? Compare this to your answer in Part (ii).
Ans- Adding a bedroom without increasing the size of the house at all results in an increase in
price of $15,200. Doing so essentially means that you would be adding a bedroom (which takes
up some number of square feet) and subtracting that number of square feet from elsewhere in the
house (so that you gained a bedroom without adding any square feet). If we now add a bedroom
and 140 square feet to a house, we increase its predicted sales price by 0.13 × 140 + 15.20 × 1 =
33.4, or $33,400 (33.4*$1000)
(iv) What percentage of the variation in price is explained by square footage and number of
bedrooms?
Ans- R Square is known as the degree of determination. It helps to find the degree of level of
correlation between the independent and the dependent variable in the dataset that helps to
predict the dependent variable.
R-Square is a statistical measure that indicates how much variation of a dependent variable is
explained by the independent variable(s) in a regression model. An R-square of 100% means that
all movements of a dependent variable are completely explained by movements in the
independent variable(s). A lower R-square means that all movements of a dependent variable are
not completely explained by movements in the independent variable(s).
Approximately 63 % of the variation in price is explained by square footage and the number
of bedrooms.