Chapter 18: Multiple Regression
Housing Prices
Real estate agents know the three most important factors in determining the price of a house are location, location, and location. But, what other factors help determine the price at which a house should be listed? Weve drawn a random sample of 1057 home sales from the public records of sales in upstate New York, in the region around the city of Saratoga Springs. The variables in the dataset are the price of the house as sold in 2002 (in dollars), the total living area (in square feet), the number of bathrooms, the number of bedrooms, the number of fireplaces, and the age of house (in years).
Lets first read the dataset into R house <- read.table('Housing_Prices_GE17.txt', sep = 't', header = TRUE) and look at its structure str(house) ## 'data.frame': 1057 obs. of 6 variables: ## $ Price : int 142212 134865 118007 138297 129470 206512 50709 108794 68353 123266 ... ## $ Living.Area: int 1982 1676 1694 1800 2088 1456 960 1464 1216 1632 ... ## $ Bedrooms : int 3 3 3 2 3 3 2 2 2 3 ... ## $ Bathrooms : num 1 1.5 2 1 1 2 1.5 1 1 1.5 ... ## $ Fireplaces : int 0 1 1 2 1 0 0 0 0 0 ... ## $ Age : int 133 14 15 49 29 10 12 87 101 14 ... Lets check the Linearity Assumption by plotting Price against each predictor variable: par(mfrow = c(1,2)) plot(house$Living.Area, house$Price, xlab = 'Living Area', ylab = 'Price') plot(factor(house$Bedrooms), house$Price, xlab = 'Bedrooms', ylab = 'Price')Hello, I have two of assignments from the Statistics, and one of assignments should be solved by using R-studio. Take a look at the attached files and solve all problems. One of assignments is based on "Ch18_hwk.pdf" and "Motorcycles.txt", and the another assignment is based in "Housing_Price.txt", "Ch18_R.pdf" and "Ch18_R.R". The duedate is within 2 days from now. Thank you for reading this.








Recent Comments