{smcl}
{* 31may2002}{...}
{hline}
help for {hi:reformat}{right:(author:  {hi:Tony Brady})}
{hline}

{title:Reformat regression output}

{p 8 17}{cmd:reformat} [{it:varlist}]
	    [{cmd:,} {cmdab:out:put(}[{cmd:e}][{cmd:s}][{cmd:z}][{cmd:p}][{cmd:c}][{cmd:n}]{cmd:)}
	    {cmd:cw(}{it:#}{cmd:)} {cmd:nocons} {cmdab:lr:test}
	    {cmdab:nois:ily} {cmdab:ef:orm} {cmd:sd} {cmd:iqr} {cmdab:dpc:oef(}{it:#}{cmd:)}
	    {cmd:dpp(}{it:#}{cmd:)} {cmdab:nf:mt(%}{it:fmt}{cmd:)} {cmdab:nobrac:kets}
	    {cmd:to(}{it:string}{cmd:)} {cmdab:del:imit(}{it:string}{cmd:)} {cmd:sort} {cmdab:pre:fix(}{it:string}{cmd:)}]


{title:Description}

{p}The output from the last regression command is re-displayed in a more
readable format using variable and value labels for clarity. The columns
to be displayed can be controlled by the user
and extra options to show the number of observations or likelihood ratio P-value
associated with each
covariate is provided. The command is particularly suited to regression
output containing dummy variables and interaction terms created by {help xi}.

{p}The reformatted output may also be copied into a spreadsheet or word-processor to create near-publication
quality tables. The best way to do this is using the {hi:delimit()}. Then
copy and paste the output into a word processor and use a `convert
text to table' option in your word processor.

{p}By default all terms fitted in the regression model are re-displayed,
although this can be restricted by specifying {it:varlist}. Auxillary parameters,
such as the second constant from {help nbreg} or the cut points from {help ologit},
are omitted.

{p}{hi:reformat} responds to two new variable characteristics (see {help char}): [units] and [mult]. The {hi:units}
characteristic is used to describe the measurement units of continuous variables such as:

{p 8 12}{inp:. char age[units] years}{p_end}
{p 8 12}{inp:. char sbp[units] mmHg}

{p}The {hi:mult} characteristic determines the unit multiplier for reporting the effect size
of a continuous variable. For instance:

{p 8 12}{inp:. char age[mult] 10}{p_end}

{p}would request effects for age to be reported per decade.


{title:Options}

{p 0 4}{cmd:output(}{it:options}{cmd:)} describes the columns to be displayed where {it:options} is
one or more of:

{p 8 10}{cmd:e} {space 3} estimated coefficient{p_end}
{p 8 10}{cmd:s} {space 3} standard error{p_end}
{p 8 10}{cmd:z} {space 3} Z-value (or t-value if appropriate){p_end}
{p 8 10}{cmd:p} {space 3} P-value{p_end}
{p 8 10}{cmd:c} {space 3} confidence interval{p_end}
{p 8 10}{cmd:n} {space 3} number of observations{p_end}

{p 4 4}Columns will be displayed in the order you specify.

{p 0 4}{cmd:cw(}{it:#}{cmd:)} is the coefficient width. This is the number of characters
allocated to describing the coefficients (22 by default). You may need to increase this
value if you have attached long value labels to variables that appear in the model.

{p 0 4}{cmd:nocons} suppresses the constant term ({help _cons}).

{p 0 4}{cmd:lrtest} replaces the usual Z-test P-values with likelihood ratio
test P-values for each term (or group of related {hi:xi} terms in the case of categorical
variables) in the model. Note this option
may take some time to process while the various models are being
fitted. {cmd:noisily} displays the raw results of the likelihood ratio
tests as they are produced.

{p 0 4}{cmd:eform} reports the coefficients in exponentiated form. Useful after
{help logit} to show odds ratios and {help poisson} to show incidence rate ratios.

{p 0 4}{cmd:sd} and {cmd:iqr} report regression coefficients for continuous variables
per standard deviation or interquartile range respectively. Useful
when the variable has a large range of values so that the regression
coefficient per unit is very small. These options have no effect on variables
that have their [mult] characteristic set.

{p 0 4}{cmd:dpcoef(}{it:#}{cmd:)} specifies the number of decimal places (3 by default) to
use when reporting the coefficients, standard errors and CIs.

{p 0 4}{cmd:dpp(}{it:#}{cmd:)} specifies the number of decimal places (3 by default) to
use when reporting the z values and p-values.

{p 0 4}{cmd:nfmt(%}{it:fmt}{cmd:)} alters the formatting applied to the number of
observations. In particular the comma format {hi:%7.0fc} might be of interest.

{p 0 4}{cmd:nobrackets} suppresses the brackets placed around the CI estimates.

{p 0 4}{cmd:to(}{it:string}{cmd:)} specifies the text to use between the lower CI and upper
CI ("to" by default). Use {hi:no} to suppress this text completely.

{p 0 4}{cmd:delimit(}{it:string}{cmd:)} causes the output to be presented with the specified
{it:string} between the columns instead of spacing. Useful when the output
is to be copied into a word-processor and converted into a table.

{p 0 4}{cmd:sort} re-arranges the variable list into ascending alphabetical order.
Useful after stepwise regression or when the same baseline variable
is involved in more than one interaction. In these situations the
variable list can become scrambled leading to unclear output.

{p 0 4}{cmd:prefix(}{it:string}{cmd:)} should be used if you used the {hi:prefix()} option
in your {help xi} command. By default {hi:reformat} assumes your categorical variables
are prefixed with _I or I (dependent on Stata version).


{title:Examples}

{p 8 12}{inp:. reformat}{p_end}
{p 8 12}{inp:. reformat, output(necp) nfmt(%7.0fc) lrtest}{p_end}
{p 8 12}{inp:. reformat, eform to(-) delim(;) dpcoef(2) dpp(2)}{p_end}

{p 8 12}{inp:. xi, prefix(_S): logistic resp i.gender i.ihd age fev1}{p_end}
{p 8 12}{inp:. reformat, prefix(_S)}{p_end}


{title:Author}

{p 8 12}Tony Brady, {browse "http://www.sealedenvelope.com/":Sealed Envelope Ltd}, U.K.{p_end}
{p 8 12}{browse "mailto:tony@sealedenvelope.com?subject=reformat.ado":tony@sealedenvelope.com}


{title:Also see}

{p 1 14}Manual:  {hi:[U] 26 Estimation and post-estimation commands},{p_end}
{p 10 14}{hi:[R] xi}

{p 0 19}On-line:  help for {help fit}, {help xi}, {help lrtest}, {help char}
