*! version 0.0.1 28jan2016

Title

influence_barchart -- Create a barchart of variable influence for boosting

Syntax

influence_barchart [, options]

min_influence(real) The minimum influence percentage required for the variable
to be displayed in the barchart. Default: min_influence(1).

top(int) Display the largest "top" number of influences.
Default: top(15).

category(int) For multinomial outcomes specify which outcome category is meant.
Default: category(1).

plotonly Generate plot from variables without processing e(influence).

tidytext("str") Remove specified string from the end of the variable label.

counttext Keep "# of" from variable label.

<other options> Any additional options are passed to the graph.

Description

influence_barchart is a postestimation command for boost by the same author.
influence_barchart creates a barchart of influence of variables in boosting using
e(influence) from the preceeding boost command.

Two variables are created "influence1" and "influence_id". If there is a multinomial outcome with k categories
additional influence variables are created up to "influence`k'"

Remarks

If there are more variables than observations, set obs is increased to the number of variables.

Options

min_influence gives a threshold value in percent (real values from 0 to 100). If the influence of a variable is below the threshold
the variable is now shown in the barchart.
The default value is 1, meaning all variables with at least 1% influence are displayed.
Only one of top or min_influence should be specified.

top Display the largest "top" number of influences. By default, the largest 15 influences are displayed.
Only one of top or min_influence should be specified.

category For multinomial outcomes in boosting the influence of x-variables are different
for different outcomes. This option specifies which for which category the barchart should
be generated. Valid inputs are integers from 1 to the number of categories.

plotonly Usually, influence variables are created and then the plot is generated from those variables.
If the variables are already created this option allows to generate the plot directly from the variables.
This is useful for generating a barchart with a different value for min_influence, or
with a different category for a multinomial outcome.

tidytext(str) The text generated by ngram contains the name of the text variable at the end as follows: " in myvar").
This option allows removes the string specified in tidytext from the end of the variable label.
The most common use is tidytext(" in myvar") where myvar is the text variable.

counttext The text generated by ngram starts with "# of <word>". This is useful for counts, but less so for indicator variables.
If not specified, this text is removed.

Additional options can be passed to graph hbar. This can be useful, for example,
if a different axis label (ytitle) is desired.

Examples

Example: Display an influence barchart with all variables that had at least 2%
influence. boost is a user-written program and has to be loaded first.

. boost y x1-x5 , influence predict(pred) dist(logistic)

. influence_barchart, min_influence(2)

Rerun with a different minimum influence cutoff:

. influence_barchart, min_influence(3) plotonly

Authors

Matthias Schonlau <schonlau@uwaterloo.ca>