Estimate: Price = β0 + β1Sqft + β2Beds + β2Baths + ε, where Price, Sqft, Beds, and Baths refer to home price, square footage, number of bedrooms, and number of bathrooms, respectively.
Price | Sqft | Beds | Baths | Col |
840000 | 2768 | 4 | 3.5 | 1 |
822000 | 2500 | 4 | 2.5 | 1 |
713000 | 2400 | 3 | 3 | 1 |
689000 | 2200 | 3 | 2.5 | 1 |
685000 | 2716 | 3 | 3.5 | 1 |
645000 | 2524 | 3 | 2 | 1 |
625000 | 2732 | 4 | 2.5 | 0 |
620000 | 2436 | 4 | 3.5 | 1 |
587500 | 2100 | 3 | 1.5 | 1 |
585000 | 1947 | 3 | 1.5 | 1 |
583000 | 2224 | 3 | 2.5 | 1 |
569000 | 3262 | 4 | 2 | 0 |
546000 | 1792 | 3 | 2 | 0 |
540000 | 1488 | 3 | 1.5 | 0 |
537000 | 2907 | 3 | 2.5 | 0 |
516000 | 1951 | 4 | 2 | 1 |
511000 | 1752 | 3 | 1.5 | 1 |
510000 | 1727 | 3 | 2 | 1 |
495000 | 1692 | 3 | 2 | 0 |
463000 | 1714 | 3 | 2 | 0 |
457000 | 1650 | 3 | 2 | 0 |
451000 | 1685 | 3 | 2 | 0 |
435000 | 1500 | 3 | 1.5 | 1 |
431700 | 1896 | 2 | 1.5 | 0 |
414000 | 1182 | 2 | 1.5 | 0 |
401500 | 1152 | 3 | 1 | 0 |
399000 | 1383 | 4 | 1 | 0 |
380000 | 1344 | 4 | 2 | 0 |
380000 | 1272 | 3 | 1 | 0 |
375900 | 2275 | 5 | 1 | 0 |
372000 | 1005 | 2 | 1 | 0 |
367500 | 1272 | 3 | 1 | 0 |
356500 | 1431 | 2 | 2 | 1 |
330000 | 1362 | 3 | 1 | 0 |
330000 | 1465 | 3 | 1 | 0 |
307500 | 850 | 1 | 1 | 0 |
a. Use R’s predict() function to construct the 95% confidence interval for the expected price of a 2,500-square-foot home in Arlington, Massachusetts, with three bedrooms and two bathrooms. (Round answers to 2 decimal places.)
Confidence interval:
b. Use R’s predict() function to construct the corresponding prediction interval for an individual home. (Round answers to 2 decimal places.)
Prediction interval:
data = read.table("../chandan/Documents/Tutoring/random data
/price",header=T)
model <- lm(Price~Sqft+Beds+Baths,data = data)
summary(model)
predict(model,data.frame(Sqft=2500,Beds=3,Baths=2),interval="confidence")
fit
lwr upr
1 578704.6 528486.5 628922.7
a)
95% confidence interval is
(528486.5,628922.7)
b)
for prediction interval
predict(model,data.frame(Sqft=2500,Beds=3,Baths=2),interval="prediction")
fit lwr
upr
1 578704.6 417921.6 739487.7
95% prediction interval is
(417921.6,739487.7)
Get Answers For Free
Most questions answered within 1 hours.