Skip to contents

Plots the dendrogram of a fitted hfr model. The heights of the levels in the dendrogram are given by a shrinkage vector, with a maximum (unregularized) overall graph height of \(p\) (the number of covariates in the regression). Stronger shrinkage leads to a shallower hierarchy.

Usage

# S3 method for hfr
plot(x, show_details = TRUE, confidence_level = 0, max_leaf_size = 3, ...)

Arguments

x

Fitted 'hfr' model.

show_details

print model details on the plot.

confidence_level

coefficients with a lower approximate statistical confidence are highlighted in the plot, see details. Default is confidence_level=0.

max_leaf_size

maximum size of the leaf nodes. Default is max_leaf_size=3.

...

additional methods passed to plot.

Value

A plotted dendrogram.

Details

The dendrogram is generated using hierarchical clustering and modified so that the height differential between any two splits is the shrinkage weight of the lower split (ranging between 0 and 1). With no shrinkage, all shrinkage weights are equal to 1 and the dendrogram has a height of \(p\). With shrinkage the dendrogram has a height of \((\kappa \times p)\).

The leaf nodes are colored to indicate the coefficient sign, with the size indicating the absolute magnitude of the coefficients.

The average standard errors along the branch of each coefficient can be used to highlight coefficients that are not statistically significant. When confidence_level > 0, branches with a lower confidence are plotted as dotted lines.

A color bar on the right indicates the relative contribution of each level to the coefficient of determination, with darker hues representing a larger contribution.

See also

hfr, se.avg, predict and coef methods

Author

Johann Pfitzinger

Examples

x = matrix(rnorm(100 * 20), 100, 20)
y = rnorm(100)
fit = hfr(x, y, kappa = 0.5)
plot(fit)