{smcl}
{* 8oct2002}{...}
{hline}
help for {hi:allpossible}
{hline}

{title:All possible models with subsets of predictors} 

{p 8 16}{cmd:allpossible} 
{it:modelcmd} 
{it:depvar} 
{it:varlist} 
[{cmd:if} {it:exp}] 
[{cmd:in} {it:range}] 
[{it:weight}] 
, 
{c -(} 
{cmd:eclass(}{it:statistics_list}{cmd:)}
{c |} 
{cmd:rclass(}{it:progname statistics_list}{cmd:)}
{c )-} 
[
{cmdab:d:etail} 
{cmd:npmax(}{it:#}{cmd:)}
{cmdab:f:ormat(}{it:format}{cmd:)}
{cmdab:cellw:idth(}{it:#}{cmd:)}
{it:modelcmd_options}] 


{title:Description}

{p}{cmd:allpossible} by default (1) computes all possible models fitted by 
{it:modelcmd} to response {it:depvar} and subsets of up to 6 predictors from 
{it: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 {cmd:npmax()} option. 

{p}{it:modelcmd} must be a command fitting a model to a single response 
variable. At least one of {cmd:eclass()} or {cmd:rclass()} must be specified.  
{cmd:eclass()} must include one or more names of e-class results, as would be 
displayed by {cmd:estimates list} after fitting an individual model. 
{cmd: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.


{title:Remarks}

{p}The number of models fitted must not exceed the number of observations. 

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

{p}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. 


{title:Options}

{p 0 4}{cmd:eclass()} specifies one or more model statistics to be 
tabulated. Statistics displayed by {cmd:estimates list} as 
{cmd:e(}{it:result}) should be specified as {it:result}. 
See the manual entry for whatever is {it:modelcmd}.

{p 0 4}{cmd: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 {it:modelcmd} and compute from them one or more 
statistics not included in the e-class results. 
Statistics left behind after {it:progname} as 
{cmd:r(}{it:result}) should be specified as {it:result}. 

{p 0 4}{cmd:detail} specifies that the results of {it:modelcmd} 
be echoed for each individual model. This may produce a large 
amount of output. 

{p 0 4}{cmd:npmax()} specifies the maximum number of predictors 
to be fitted. 

{p 0 4}{cmd:format()} and {cmd:cellwidth()} are options of 
{help tabdisp}. The default values are {cmd:format(%4.3f) cellwidth(12)}. 

{p 0 4}{it:modelcmd_options} are other options of {it:modelcmd}. 


{title:Examples}

{p 4 8}{inp:. gen gpm = 1 / mpg}{p_end} 
{p 4 8}{inp:. allpossible regress gpm head-disp, eclass(rmse r2_a)} 

{p 4 8}{inp:. allpossible glm mpg weight-displacement, rclass(glmcorr rmse rho jrho) link(power -1)} 


{title:Author}

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


{title:Acknowledgements} 

{p 4 4}This program draws upon the 
{net "describe rsquare, from(http://www.ats.ucla.edu/stat/stata/ado/analysis)":rsquare}  
program by Philip B. Ender and Rie von Eyben, UCLA. 
  

{title:Also see}

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