AmesHousing
This package contains the data described by De Cock (2011) where 82 fields were recored for 2,930 properties in Ames IA. Different versions of the data are available using the package.
Installation
To install the package from CRAN, use
install.packages("AmesHousing")You can install the development version of AmesHousing from GitHub with:
# install.packages("devtools")
devtools::install_github("topepo/AmesHousing")Details
- Using
data(ames_raw), a tibble is attached with the data as it is found on the website. - Using the command,
make_ames()a tibble is returned that has a processed version of the data (see notes below). - The command
make_ordered_ames()returns a similar tibble but several of the variables are formatted as ordered factors.
The Processed Version
The exact details can be found in the code of make_ames but a summary is:
- All factors are unordered.
PIDandOrderare removed.- Spaces and special characters in column names where changed to snake case. To be consistent,
SalePricewas changed toSale_Price. - One row was removed with an unexplained missing value.
- Many factor levels were changed to be more understandable (e.g.
Split_or_Multilevelinstead of080) - Many missing values were reset. For example, if the variable
Bsmt_Qualwas missing, this implies that there is no basement on the property. Instead of a missing value, the value ofBsmt_Qualwas changed toNo_Basement. Similarly, numeric data pertaining to basements were set to zero where appropriate such as variablesBsmt_Full_BathandTotal_Bsmt_SF. Garage_Yr_Bltcontained many missing data and was removed.- Approximate longitude and latitude are included for the properties. Also, note that there are 6 properties with identical geotags. These are units within the same building.
The Ordered Factor Version
make_ordinal_ames is the same as make_ames but many ordinal data were changed to class ordered.