-------------------------------------------------------------------------------
help for allpossible
-------------------------------------------------------------------------------

All possible models with subsets of predictors

allpossible modelcmd depvar varlist [if exp] [in range] [weight] , { eclass(statistics_list) | rclass(progname statistics_list) } [ detail npmax(#) format(format) cellwidth(#) modelcmd_options]

Description

allpossible by default (1) computes all possible models fitted by modelcmd to response depvar and subsets of up to 6 predictors from varlist and (2) tabulates various summary statistics for each model fitted. Alternatively, (1') the maximum number of predictors fitted may be specified as a number less than 6 by the npmax() option.

modelcmd must be a command fitting a model to a single response variable. At least one of eclass() or rclass() must be specified. eclass() must include one or more names of e-class results, as would be displayed by estimates list after fitting an individual model. rclass() must include the name of a program that would execute without arguments after a model command and one or more names of r-class results it produces.

Remarks

The number of models fitted must not exceed the number of observations.

The upper limit of 6 is not a matter of principle. The limit may be changed in a future version.

Naturally, this command does not purport to replace the detailed scrutiny of individual models or to offer an unproblematic way of finding "best" models. Its main use may lie in demonstrating that several models exist within many projects possessing roughly equal merit as measured by omnibus statistics.

Options

eclass() specifies one or more model statistics to be tabulated. Statistics displayed by estimates list as e(result) should be specified as result. See the manual entry for whatever is modelcmd.

rclass() specifies the name of a program that would execute without arguments after a model command and one or more names of r-class results it produces. For example, users may write an r-class program to pick up e-class results after modelcmd and compute from them one or more statistics not included in the e-class results. Statistics left behind after progname as r(result) should be specified as result.

detail specifies that the results of modelcmd be echoed for each individual model. This may produce a large amount of output.

npmax() specifies the maximum number of predictors to be fitted.

format() and cellwidth() are options of tabdisp. The default values are format(%4.3f) cellwidth(12).

modelcmd_options are other options of modelcmd.

Examples

. gen gpm = 1 / mpg . allpossible regress gpm head-disp, eclass(rmse r2_a)

. allpossible glm mpg weight-displacement, rclass(glmcorr rmse rho jrho) link(power -1)

Author

Nicholas J. Cox, University of Durham, U.K. n.j.cox@durham.ac.uk

Acknowledgements

This program draws upon the rsquare program by Philip B. Ender and Rie von Eyben, UCLA.

Also see

On-line: help for estimates, return, rsquare (if installed), glmcorr (if installed)