help for reformat                                         (author:  Tony Brady)

Reformat regression output

reformat [varlist] [, output([e][s][z][p][c][n]) cw(#) nocons lrtest noisily eform sd iqr dpcoef(#) dpp(#) nfmt(%fmt) nobrackets to(string) delimit(string) sort prefix(string)]


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 xi.

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 delimit(). Then copy and paste the output into a word processor and use a `convert text to table' option in your word processor.

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

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

. char age[units] years . char sbp[units] mmHg

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

. char age[mult] 10

would request effects for age to be reported per decade.


output(options) describes the columns to be displayed where options is one or more of:

e estimated coefficient s standard error z Z-value (or t-value if appropriate) p P-value c confidence interval n number of observations

Columns will be displayed in the order you specify.

cw(#) 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.

nocons suppresses the constant term (_cons).

lrtest replaces the usual Z-test P-values with likelihood ratio test P-values for each term (or group of related 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. noisily displays the raw results of the likelihood ratio tests as they are produced.

eform reports the coefficients in exponentiated form. Useful after logit to show odds ratios and poisson to show incidence rate ratios.

sd and 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.

dpcoef(#) specifies the number of decimal places (3 by default) to use when reporting the coefficients, standard errors and CIs.

dpp(#) specifies the number of decimal places (3 by default) to use when reporting the z values and p-values.

nfmt(%fmt) alters the formatting applied to the number of observations. In particular the comma format %7.0fc might be of interest.

nobrackets suppresses the brackets placed around the CI estimates.

to(string) specifies the text to use between the lower CI and upper CI ("to" by default). Use no to suppress this text completely.

delimit(string) causes the output to be presented with the specified string between the columns instead of spacing. Useful when the output is to be copied into a word-processor and converted into a table.

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.

prefix(string) should be used if you used the prefix() option in your xi command. By default reformat assumes your categorical variables are prefixed with _I or I (dependent on Stata version).


. reformat . reformat, output(necp) nfmt(%7.0fc) lrtest . reformat, eform to(-) delim(;) dpcoef(2) dpp(2)

. xi, prefix(_S): logistic resp i.gender i.ihd age fev1 . reformat, prefix(_S)


Tony Brady, Sealed Envelope Ltd, U.K. tony@sealedenvelope.com

Also see

Manual: [U] 26 Estimation and post-estimation commands, [R] xi