get.nused.preds.per.subset {earth}R Documentation

Number of predictors in an 'earth' object

Description

Get the number of predictors in a model which is a subset of an ‘earth’ model.

Usage

get.nused.preds.per.subset(dirs, which.terms)

Arguments

dirs dirs component of an earth object.
which.terms Typically the selected.terms or prune.terms component of an earth object.

Value

The number of predictors used in the model specified by which.terms. If which.terms is a matrix such as prune.terms, the value is a vector.

See Also

earth, get.nterms.per.degree,

Examples

data(ozone1)
a <- earth(O3 ~ ., data = ozone1, degree = 2)
get.nused.preds.per.subset(a$dirs, a$selected.terms)

# yields:
#    [1] 8     # there are 8 predictors in selected.terms

get.nused.preds.per.subset(a$dirs, a$prune.terms)

# yields:
#    [1] 0 1 2 3 4 4 5 6 7 7 8 8 8 8 8 8 8 8 8 8 8

[Package earth version 1.0-8 Index]