Question

The questions involve the data set for asking prices of Richmond townhouses obtained on 2014.11.03.
For your subset, the response variable is:
asking price divided by 10000:
askpr=c(53.9, 50.8, 46.8, 48.8, 62.9, 68.8, 62.8888, 58.68, 54.8, 79.99, 55.8, 60.8, 73.8, 56.88, 25.9, 47.9, 65.8, 45.99, 59.8, 50.8, 57.8, 55.2, 54.8, 52.4, 56.8, 81.9, 40.8, 48.5, 51.68, 58.8, 40.8, 33.7, 68.5, 53.8, 41.99, 58.39, 68.5, 73.9, 79.8, 26.99, 68.8, 47.8, 78.8, 71.99, 57.5, 54.98, 77.8, 57.8, 53.8, 74.8)
The explanatory variables are:
(i) finished floor area divided by 100
ffarea=c(11.84, 16.6, 16.2, 14.8, 14, 16.9, 15.77, 13.96, 11.26, 22, 13.06, 13.2, 17.54, 15.78, 6.1, 12.1, 13.45, 16.01, 17.63, 12.27, 13.84, 15.3, 15.46, 16.22, 15.5, 20.95, 14, 14.8, 15.1, 17.37, 12.26, 12, 13.59, 10.95, 12.9, 15.09, 15.76, 15.15, 15.25, 10.5, 15.95, 13.34, 19.48, 15.05, 13.46, 13.06, 16.5, 12.01, 12.22, 17.48)
(ii) age
age=c(15, 23, 30, 50, 5, 8, 6, 9, 0, 20, 0, 3, 9, 17, 11, 7, 1, 25, 26, 17, 10, 9, 41, 25, 23, 19, 38, 24, 20, 26, 29, 28, 2, 18, 44, 8, 4, 0, 3, 37, 18, 32, 11, 8, 10, 1, 3, 0, 9, 5)
(iii) monthly maintenance fee divided by 10
mfee=c(21, 19.9, 16, 25, 19.6, 19.4, 35.7, 22, 24.8, 26.7, 18.6, 18.9, 18.2, 17.3, 17.1, 18, 18.2, 33.7, 32, 25.2, 16, 16.9, 31, 36.4, 17.4, 34.8, 23, 16.1, 24.5, 31, 19.8, 25.9, 17, 24.7, 23.2, 20.3, 22.1, 22.2, 35, 28, 23.6, 24.5, 20.4, 22.3, 22.1, 19.6, 25.4, 14.2, 18.5, 29.7)
(iv) number of bedrooms
beds=c(2, 4, 4, 3, 3, 4, 3, 3, 2, 3, 3, 3, 4, 4, 1, 3, 3, 3, 5, 2, 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 3, 2, 3, 2, 3, 4, 4, 4, 2, 2, 3, 3, 3, 3, 3, 3, 4, 3, 3, 4)
You are to make a prediction of the response variable when ffarea=16, age=6, mfee=26, beds=4.

You are to fit three multiple regression models with the response variable askpr:
(i) 2 explanatory variables ffarea, age
(ii) 3 explanatory variables ffarea, age, mfee
(iii) 4 explanatory variables ffarea, age, mfee, beds
After you have copied the above R vectors into your R session, you can get a dataframe with
richmondtownh=data.frame(cbind(askpr,ffarea,age,mfee,beds))

Please use 3 decimal places for the answers below which are not integer-valued

Part a) The values of adjusted R2 for the above models with 2, 3 and 4 explanatory variables are respectively: 2 explanatory: 3 explanatory: 4 explanatory: Part b) For the best of these 3 models based on adjusted R2, the number of explanatory variables is: Part c) For the best of these 3 models based on adjusted R2, the least squares coefficient for ffarea is and a 95% confidence interval for Brarea is to Part d) For the best of these 3 models based on adjusted R2 , get the prediction, SE and 95% prediction interval when the future values of the explanatory variables are: ffarea-16, age-6, mfee-26, beds-4. prediction and the upper endpoint of the 95% prediction interval is and its SE

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

Part a.

Adjusted R square for

2 explanatory 0.805

3 explanatory 0.805

4 explanatory 0.805

Part b.

Number of explanatory variables: 2

Part c.

Coefficient for ffarea = 3.519

95% CI = (2.907, 4.131)

Part d:

Prediction: 68.104      SE= 5.727

Upper endpoint of 95% prediction: 79.859

Rcode:

askpr=c(53.9, 50.8, 46.8, 48.8, 62.9, 68.8, 62.8888, 58.68, 54.8, 79.99, 55.8, 60.8, 73.8, 56.88, 25.9, 47.9, 65.8, 45.99, 59.8, 50.8, 57.8, 55.2, 54.8, 52.4, 56.8, 81.9, 40.8, 48.5, 51.68, 58.8, 40.8, 33.7, 68.5, 53.8, 41.99, 58.39, 68.5, 73.9, 79.8, 26.99, 68.8, 47.8, 78.8, 71.99, 57.5, 54.98, 77.8, 57.8, 53.8, 74.8)

ffarea=c(11.84, 16.6, 16.2, 14.8, 14, 16.9, 15.77, 13.96, 11.26, 22, 13.06, 13.2, 17.54, 15.78, 6.1, 12.1, 13.45, 16.01, 17.63, 12.27, 13.84, 15.3, 15.46, 16.22, 15.5, 20.95, 14, 14.8, 15.1, 17.37, 12.26, 12, 13.59, 10.95, 12.9, 15.09, 15.76, 15.15, 15.25, 10.5, 15.95, 13.34, 19.48, 15.05, 13.46, 13.06, 16.5, 12.01, 12.22, 17.48)

age=c(15, 23, 30, 50, 5, 8, 6, 9, 0, 20, 0, 3, 9, 17, 11, 7, 1, 25, 26, 17, 10, 9, 41, 25, 23, 19, 38, 24, 20, 26, 29, 28, 2, 18, 44, 8, 4, 0, 3, 37, 18, 32, 11, 8, 10, 1, 3, 0, 9, 5)

mfee=c(21, 19.9, 16, 25, 19.6, 19.4, 35.7, 22, 24.8, 26.7, 18.6, 18.9, 18.2, 17.3, 17.1, 18, 18.2, 33.7, 32, 25.2, 16, 16.9, 31, 36.4, 17.4, 34.8, 23, 16.1, 24.5, 31, 19.8, 25.9, 17, 24.7, 23.2, 20.3, 22.1, 22.2, 35, 28, 23.6, 24.5, 20.4, 22.3, 22.1, 19.6, 25.4, 14.2, 18.5, 29.7)

beds=c(2, 4, 4, 3, 3, 4, 3, 3, 2, 3, 3, 3, 4, 4, 1, 3, 3, 3, 5, 2, 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 3, 2, 3, 2, 3, 4, 4, 4, 2, 2, 3, 3, 3, 3, 3, 3, 4, 3, 3, 4)

richmondtownh=data.frame(cbind(askpr,ffarea,age,mfee,beds))

Model1 <- lm(askpr ~ ffarea+age, data= richmondtownh)

summary(Model1)

Model2 <- lm(askpr ~ ffarea+age+mfee, data= richmondtownh)

summary(Model2)

Model3 <- lm(askpr ~ ffarea+age+mfee+beds, data= richmondtownh)

summary(Model3)

confint(Model1, 'ffarea', level=0.95)

newdata = data.frame(ffarea=16,age=6)

predict(Model1, newdata, interval="prediction",conf.level=.95)

R output:

Call:

lm(formula = askpr ~ ffarea + age, data = richmondtownh)

Residuals:

     Min       1Q   Median       3Q      Max

-11.1668 -4.4598 -0.0047   3.8634 12.6005

Coefficients:

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

(Intercept) 15.2711     4.5777   3.336 0.00167 **

ffarea        3.5189     0.3044 11.560 2.43e-15 ***

age          -0.5780     0.0639 -9.046 7.35e-12 ***

---

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

Residual standard error: 5.735 on 47 degrees of freedom

Multiple R-squared: 0.8128,    Adjusted R-squared: 0.8048

F-statistic:   102 on 2 and 47 DF, p-value: < 2.2e-16

>

> Model2 <- lm(askpr ~ ffarea+age+mfee, data= richmondtownh)

> summary(Model2)

Call:

lm(formula = askpr ~ ffarea + age + mfee, data = richmondtownh)

Residuals:

     Min       1Q   Median       3Q      Max

-12.5179 -4.6707   0.0602   3.7629 10.7233

Coefficients:

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

(Intercept) 13.59960    4.86405   2.796 0.00753 **

ffarea       3.40351    0.32486 10.477 9.06e-14 ***

age         -0.59727    0.06664 -8.963 1.17e-11 ***

mfee         0.15875    0.15654   1.014 0.31585   

---

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

Residual standard error: 5.733 on 46 degrees of freedom

Multiple R-squared: 0.8169,    Adjusted R-squared: 0.8049

F-statistic: 68.39 on 3 and 46 DF, p-value: < 2.2e-16

> Model3 <- lm(askpr ~ ffarea+age+mfee+beds, data= richmondtownh)

> summary(Model3)

Call:

lm(formula = askpr ~ ffarea + age + mfee + beds, data = richmondtownh)

Residuals:

    Min      1Q Median      3Q     Max

-12.150 -4.676   0.081   3.869 10.782

Coefficients:

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

(Intercept) 15.94889   5.35275   2.980 0.00464 **

ffarea       3.62634    0.38817   9.342 4.19e-12 ***

age         -0.59718    0.06657 -8.971 1.39e-11 ***

mfee         0.09248    0.16872   0.548 0.58633   

beds        -1.35115    1.29136 -1.046 0.30101   

---

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

Residual standard error: 5.727 on 45 degrees of freedom

Multiple R-squared: 0.8212,    Adjusted R-squared: 0.8053

F-statistic: 51.67 on 4 and 45 DF, p-value: 2.933e-16

confint(Model1, 'ffarea', level=0.95)

          2.5 %   97.5 %

ffarea 2.906502 4.131211

>

> newdata = data.frame(ffarea=16,age=6)

> predict(Model1, newdata, interval="prediction",conf.level=.95)

       fit      lwr      upr

1 68.10448 56.34961 79.85935

>

Add a comment
Know the answer?
Add Answer to:
The questions involve the data set for asking prices of Richmond townhouses obtained on 2014.11.03. For...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT