The R-Language “earth” Package

Last year Minitab purchased Salford Systems and increased the price of all their packages. In particular, it now costs about $15,000 to purchase their MARS package, putting it well out of the reach of most residential appraisers.

The closest substitute for Salford Systems MARS package is the R Language package “earth”. However when I last used it about 12 years ago, it did not provide satisfactory models. It has however been upgraded several times by Stephen Milborrow.

Although I am grandfathered into yearly upgrades of Salford Sytems MARS at the old low fee, I would like to be able to reference MARS techniques in appraisals, articles and perhaps courses for other appraisers. It is therefore necessary to know whether there is an alternative MARS application available for other appraisers, reviewers and clients. So, I took some time this week-end to look at the latest version of R/earth.

The good news is that the latest version of R/earth now provides models that appear to be fairly comparable to those provided by Salford Sytems MARS. It is also very fast. I should warn I have been using the Salford Systems product since about 2003 and am pretty good at tweaking the numerous parameters. On the other hand, I am not nearly so experienced with the earth package. I am therefore sure that with more experience I could likely do more tweaking of the R/earth parameters and supporting packages to obtain better results and more output. While I’m inclined to believe that the Salford Systems package is easier to use and more robust, I can’t say for sure without more extensive experience using R and earth.

Nonetheless, I conclude that the latest earth package is very good and should be a very useful and productive tool for advanced appraisers.

I have uploaded a data set the contains a subset of the fields for a sales transactions for several MLS areas in Pacifica going from January 30, 2001 to January 30, 2018. You can find this on:

This public GitHub directory contains the data as MyData.csv, a spreadsheet side-by-side comparison of the output of Earth and Mars, a list of the R/earth commands used and a report of the Salford Systems MARS ouput with graphs. The graphs for the R/earth output should look similar, although it doesn’t generate quite as many basis functions.

How to use Earth:

Put your data in a CSV. I would recommend putting all of the columns contain data for prediction in the leftmost columns, and the target variable, the variable you want to predict, in the rightmost column. Avoid placing any other data in the spreadsheet. Use only one sheet to keep things simple.
If you follow the previous step, then assuming your data is in a spreadsheet stored as C:\Data\MyData.csv, use the following R commands

MyData = read.csv(“d:\data\MyData.csv”,header=TRUE)

The above will quickly produce the following model:

y =  610,000 +

+ 234 * pmax(0, 1887 – SaleAge) // “SaleAge” is days COE before 1/30/2018
– 455 * pmax(0, SaleAge – 1887)
+ 591 * pmax(0, SaleAge – 2164)
– 435 * pmax(0, SaleAge – 4498)
+ 239 * pmax(0, SaleAge – 5439)

+ 49318 * pmax(0, AreaID – 652)
+ 14475 * pmax(0, 654 – AreaID)
– 66058 * pmax(0, AreaID – 654)

– 120 * pmax(0, 1450 – LivingSqFt)
+ 148 * pmax(0, LivingSqFt – 1450)

– 6.9 * pmax(0, 15041 – LotSize)
+ 6.2 * pmax(0, LotSize – 15041)

– 22086 * pmax(0, 2 – Garage)
+ 85767 * pmax(0, Garage – 2)

  • This models has a reported R2 or about 0.82. The Salford Systems model has a higher R2 of over 0.84 and provides a somewhat better model – most likely due to my more extensive experience working with it.

    CONCLUSION: Appraisers will find the R/earth package quite adequate for appraisal work using Multivariate Adaptive Regaression Splines (MARS).

Footnote: Earth is called “earth” because Salford Systems has put a trademark on their MARS software package and won’t let anyone else use it as a label for a software application. Therefore, “earth.”

Leave a Reply