rpart_ci | R Documentation |
Fit an rpart
model using the concentration index as a measure of deviance.
rpart_ci(formula, data, weights, type = c("CI", "CIg", "CIc"),
subset, na.action = na.rpart, model = FALSE, x = FALSE,
y = TRUE, control, cost, ...)
formula |
a |
data |
an optional data frame in which to interpret the variables named in the formula. |
weights |
optional case weight |
type |
one of |
subset |
optional expression saying that only a subset of the rows of the data should be used in the fit. |
na.action |
the default action deletes all observations for which y is missing, but keeps those in which one or more predictors are missing. |
model |
if logical: keep a copy of the model frame in the result? If the input value for model is a model frame (likely from an earlier call to the rpart function), then this frame is used rather than constructing new data. |
x |
keep a copy of the x matrix in the result. |
y |
keep a copy of the dependent variable in the result. If missing and model is supplied this defaults to FALSE. |
control |
a list of options that control details of the |
cost |
a vector of non-negative costs, one for each variable in the model. Defaults to one for all variables. These are scalings to be applied when considering splits, so the improvement on splitting on a variable is divided by its cost in deciding which split to choose. |
... |
arguments to |
An object of class rpart
. See rpart.object
.
Saveria Willimes and Brecht Devleesschauwer, adapting from the rpart
package by Terry M.Therneau and Beth Atkinson.
Breiman L., Friedman J. H., Olshen R. A., and Stone, C. J. (1984) Classification and Regression Trees. Wadsworth.
imp
,
rpart.control
, rpart.object
,
summary.rpart
, print.rpart
data(nigeria)
tree <-
rpart_ci(
cbind(wealth, zscore1) ~
quintile + ed + rural + region + male + bord + agechild + agemother,
data = nigeria,
weights = nigeria$weight,
type = "CI")
plot(tree, xpd = NA)
text(tree, use.n = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.