get.nused.preds.per.subset {earth} | R Documentation |
Get the number of predictors in a model which is a subset of an ‘earth’ model.
get.nused.preds.per.subset(dirs, which.terms)
dirs |
dirs component of an earth object.
|
which.terms |
Typically the selected.terms or prune.terms
component of an earth object.
|
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.
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