HTT: Hypothesis Testing Tree In HTT: Hypothesis Testing Tree

 Hypothesis Testing Tree R Documentation

Hypothesis Testing Tree

Description

Fit a hypothesis testing tree.

Usage

``````HTT(formula, data, method, distance, controls = htt_control(...), ...)
``````

Arguments

 `formula` a symbolic description of the model to be fit. `data` a data frame containing the variables in the model. `method` `"regression"` or `"classification"`. If `method` is missing then the routine tries to make an intelligent guess. If `Y` is factor, then `method = "classification"`. If `Y` is numeric vector or numeric matrix, then `method = "classification"`. `distance` If `distance` is missing, then Euclidean distance with exponent alpha is used for regression tree, 0-1 distance is used for classification tree. Otherwise, use the `distance` as the distance matrix of `Y`. `controls` a list of options that control details of the `HTT` algorithm. See `htt_control`. `...` arguments passed to `htt_control`.

Details

Hypothesis testing trees examines the distribution difference over two child nodes by the binary partitioning in a hypothesis testing framework. At each split, it finds the maximum distribution difference over all possible binary partitions, the test statistic is based on generalized energy distance. The permutation test is used to estimate the p-value of the hypothesis testing.

Value

An object of class `htt`. See `htt.object`.

Author(s)

Jiaqi Hu

`htt_control`, `print.htt`, `plot.htt`, `predict.htt`

Examples

``````## regression
data("Boston", package = "MASS")
Bostonhtt <- HTT(medv ~ . , data = Boston, controls = htt_control(R = 99))
plot(Bostonhtt)
mean((Boston\$medv - predict(Bostonhtt))^2)

## classification
irishtt <- HTT(Species ~., data = iris)
plot(irishtt)
mean(iris\$Species == predict(irishtt))
``````

HTT documentation built on March 31, 2023, 5:40 p.m.