Description Usage Arguments Value Examples

Performs tree-structured sparse discriminant analysis using an augmented predictor matrix with additional predictors corresponding to the nodes and then translating the parameters back in terms of only the leaves.

1 2 |

`response` |
A factor or character vector giving the class to be predicted. |

`predictors` |
A matrix of predictor variables corresponding to the leaves of the tree and in the same order as the leaves of the tree. |

`tree` |
A tree of class |

`p` |
The number of predictors to use. |

`k` |
The number of components to use. |

`center` |
Center the predictor variables? |

`scale` |
Scale the predictor variables? |

`class.names` |
Optional argument giving the class names. |

`check.consist` |
Check consistency of the predictor matrix and the tree. |

`A` |
A matrix describing the tree structure. If it has been computed before it can be passed in here and will not be recomputed. |

`...` |
Additional arguments to be passed to sda |

An object of class `treeda`

. Contains the coefficients
in the original predictor space (`leafCoefficients`

), the
number of predictors used in the node + leaf space
(`nPredictors`

), number of leaf predictors used
(`nLeafPredictors`

), the projections of the samples onto
the discriminating axes (`projections`

), and the sparse
discriminant analysis object that was used in the fit
(`sda`

).

1 2 3 4 5 6 | ```
data(treeda_example)
out.treeda = treeda(response = treeda_example$response,
predictors = treeda_example$predictors,
tree = treeda_example$tree,
p = 1)
out.treeda
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.