s-news
[Top] [All Lists]

Categorical variables in MDA/MARS?

To: <s-news@lists.biostat.wustl.edu>
Subject: Categorical variables in MDA/MARS?
From: "Ben Gilmer" <Ben.Gilmer@mail.wvu.edu>
Date: Thu, 27 Oct 2005 18:54:06 -0400
I have a quick question about the ability to use categorical predictor
variables (one with 6 factors, another with 25 factors) with MARS (from
Hastie's MDA package), in either Splus or R. 
I've found references to several versions of the MDA package on the
web, but none seem to be without the caveat written in the description
by Hastie and Tibshirani ("This function was coded from scratch, ... We
have not implemented Friedman's anova decomposition nor are categorical
predictors handled properly yet.").
I'm able to construct a mars model with training data when some of the
predictor variables are categorical, but I get this error when I try to
predict the results using test data with categorical variables (using
"predict.mars"): 
Problem in x[, k] - cut[j, k]: Non-numeric first operand
(I'm using Splus 2000, and the categorical variable is numeric (eg.
1110, 1120) but coded as a factor).
I found the mda package with the most recent date (Sep 2005) here:
http://lib.stat.cmu.edu/R/CRAN/doc/packages/mda.pdf 
but I noticed that the description about mars still contains the line
about categorical variables not being handled properly.

I've seen implementations of MARS with categorical predictor variables
in papers, so I was wondering if there is some kind of work-around I'm
missing?
Thanks very much for your help,

Ben Gilmer

<Prev in Thread] Current Thread [Next in Thread>
  • Categorical variables in MDA/MARS?, Ben Gilmer <=