------------------------------------------------------------------------------- help forreformat(author:Tony Brady) -------------------------------------------------------------------------------

Reformat regression output

reformat[varlist] [,output([e][s][z][p][c][n])cw(#)noconslrtestnoisilyeformsdiqrdpcoef(#)dpp(#)nfmt(%fmt)nobracketsto(string)delimit(string)sortprefix(string)]

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

reformatresponds to two new variable characteristics (see char): [units] and [mult]. Theunitscharacteristic is used to describe the measurement units of continuous variables such as:. char age[units] years . char sbp[units] mmHg

The

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

Options

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

eestimated coefficientsstandard errorzZ-value (or t-value if appropriate)pP-valuecconfidence intervalnnumber of observationsColumns 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.

noconssuppresses the constant term (_cons).

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

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

sdandiqrreport 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.0fcmight be of interest.

nobracketssuppresses the brackets placed around the CI estimates.

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

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

sortre-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 theprefix()option in your xi command. By defaultreformatassumes your categorical variables are prefixed with _I or I (dependent on Stata version).

Examples. 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)

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

Also seeManual:

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