earth2sas: Export a MARS model to SAS

Description Usage Arguments Details Examples

Description

Generate SAS DATA step code to predict the values of a Multivariate Adaptive Regression Splines (MARS) model from the earth package.

Usage

1
earth2sas(fit, name = "prediction", type = "link")

Arguments

fit

a MARS model trained by earth. It may be tuned using train.

name

the name of the variable in which to store the prediction

type

For classification models type=link gives log-odds, while type=response gives probabilities.

Details

This function supports regression and binary classification (when earth is called with glm=list(family=binomial).

This function supports only numeric variables, so any factors must first be converted to numeric variables (as train normally does).

Interactions (degree > 1) are supported.

Examples

1
2
3
4
require(earth)
trees.earth <- earth(Volume ~ ., data=trees)
trees.sas <- earth2sas(trees.earth)
cat(trees.sas, file="trees.sas")

az0/mlmeta documentation built on May 11, 2019, 4:15 p.m.