.- help for ^outreg^ (STB-46: sg97; STB-49: sg97.1; STB-58: sg97.2) .- Write formatted regression output to a text file ------------------------------------------------ After any estimation command: ^outreg^ [varlist] ^using^ filename [^,^ (Text-related Options) ^nol^abel ^ti^tle^(^textlist^)^ ^ct^itle^(^textlist^)^ ^nonot^es ^addn^ote^(^textlist^)^ (Coefficient Options) ^bd^ec^(^numlist^)^ ^bf^mt^(^textlist^)^ ^coe^fastr (t-Statistic/Standard Error/p-Value Options) {^se^ | ^p^value} ^td^ec^(^#^)^ ^nopa^ren ^br^acket {^noas^ter | ^3aster^ | ^10pct^} ^si^gsymb^(^textlist^)^ (Statistics Options) ^nocon^s ^nonob^s ^noni^ ^nor^2 ^ad^jr2 ^rd^ec^(^#^)^ ^adds^tat^("^text^", ^# [^," ^text^", ^# ...]^)^ ^ade^c^(^#^)^ ^ef^orm ^m^arginal ^o^necol ^x^stats (Other Options) ^com^ma ^replace^ ^ap^pend] n.b. a textlist (my own term) is a list of text separated by commas, i.e. "text" [, "text" ...]. It is similar to a numlist or a varlist, but commas are required. Each text element in the list does not need to be enclosed in quotation marks unless the text contains commas or parentheses. Description ----------- ^outreg^ formats regression output as it is presented in most documents: t-statistics or standard errors in parentheses under each coefficient, asterisks indicating coefficients statistically different from zero, and summary statistics like R-squared at the bottom. The formatted output is written to a tab- or comma-separated ASCII file, which can then be loaded into wordprocessing or spreadsheet programs to be converted directly to a table. For example, the output file can be opened in Microsoft Word, the text selected, and then converted to a table by choosing Table, then Convert Text to Table. Note that when loading the output into a spreadsheet, the parentheses around the t-statistics may convert to negative numbers. ^outreg^ should work after any Stata estimation command (see ^estimation^ ^commands^ in Stata manual for a complete list). Like @predict@, ^outreg^ makes use of internally saved estimation results, so it should be invoked immediately after the estimation. In addition to coefficient estimates, by default ^outreg^ will report t-statistics with asterisks for standard significance levels (1% and 5%), number of observations, true R-squareds (no pseudo R-squareds), and the number of groups in panel estimation. The user can add their own chosen titles (^title^ and ^ctitle^), statistics (^addstat^), and notes (^addnote^) to the table, and change many other aspects of the output. ^outreg^ rewards the use of variable @label@s (and value labels for @mlogit@, @svymlog@, and @net:describe dlogit2, from (http://www.stata.com/users/wsribney)!dmlogit2@). The variable labels are used in the output table (unless ^nolabel^ is chosen), providing more intelligible variable descriptions than 8-letter names. Note that if different variables are assigned the same variable label (not usually done intentionally), and more than one regression is appended together, the coefficients and t-statistics will not be properly ordered. The solution is to use distinct variable labels or the ^nolabel^ option. If filename is specified without an extension, ^.out^ is assumed. Several regressions with differing variables can be combined into a single table with the ^append^ option. See the last example below. If a varlist is specified, only the regression coefficients corresponding to the variables in varlist will be included in the table. The intercept coefficient is included as well unless the ^nocons^ option is chosen. This is probably most useful for excluding numerous dummy variable coefficients. Time series prefixes are not allowed when using an explicit varlist. Options ------- 1. Text-related Options 2. Coefficient Options 3. t-Statistic/Standard Error/etc. Options 4. Other Statistics Options 5. Other Options 1. Text-related Options ----------------------- ^nolabel^ specifies that variable names rather than variable labels be used to identify coefficients. It also suppresses the value labels of the dependent variable in @mlogit@ and @svymlog@. ^title(^textlist^)^ specifies a title or titles at the top of the regression table. The maximum title length is 80 characters. Additional characters will be cut off. Longer titles can be put in two or more title lines. When regression results are appended together, the table title(s) must be specified in the first ^outreg^ call; titles specified in subsequent ^outeg ... append^ calls will be ignored. Note that when converting the @outreg@ text output to a table in a word processor or a spreadsheet, it is easier to leave out the title row out of the text selected for conversion. ^ctitle(^textlist^)^ specifies the regression title above the coefficient column. By default if no column title is specified, the label or name of the dependent variable is displayed. Multiple column titles are only appropriate for multi-equation regressions, using one title per equation, and then only if not ^onecol^. ^nonotes^ specifies that notes explaining the t-statistics (or standard errors) and asterisks not be included. ^addnote(^textlist^)^ specifies user-added notes to be displayed in new lines at the bottom of the @outreg@ table. When regression results are appended together, ^addnote^ must be specified in the first ^outreg^ call; ^addnote^s specified in subsequent ^outreg ... append^ calls will be ignored. ^addnote^ is consistent with ^nonotes^. A blank line can be inserted by including "" as a note. Technical Note: Text which includes quotation marks within the text (by means of double quotation) in ^title^, ^ctitle^, and ^addnote^ displays correctly in single regression tables, but does not display correctly when subsequent regressions are ^append^ed. 2. Coefficient Options ---------------------- ^bdec(^numlist^)^ specifies the number of decimal places reported for coefficient estimates (the b's). It also specifies the decimal places reported for standard errors or confidence intervals if ^se^ or ^ci^ is chosen. The default value for ^bdec^ is 3. The minimum value is 0, and the maximum value is 11. If one number is specified in the numlist, it will apply to all coefficients. If multiple numbers are specified in the numlist, the first number will determine the decimals reported for the first coefficient, the second number, the decimals for the second coefficient, etc. If there are fewer numbers in the numlist than coefficients, the last number in the numlist will apply to all the remaining coefficients. ^bfmt(^textlist^)^ specifies the format type for coefficient estimates (and standard errors or confidence intervals, if ^se^ or ^ci^ is chosen). Possible format types are e - scientific notation; e.g. 1.00e+3 f or fc - fixed format (with commas for thousands with fc) g or gc - general format (with commas for thousands with gc) The default type for ^bfmt^ is fc. If multiple format types are specified, they are applied to the coefficients the way that multiple ^bdec^ parameters are applied. This option is mainly to allow scientific notation (e). For an explanation of Stata numeric formats, see ^[U] 15.5.1 Numeric formats^. ^coefastr^ specifies that asterisks for significance levels are appended to regression coefficients rather than to t-statistics or standard errors. 3. t-Statistic/Standard Error/etc. Options --------------------------------------------- ^se^ specifies that standard errors rather than t-statistics are reported. ^pvalue^ specifies that p values (of t-statistics) rather than t-statistics are reported. ^ci^ specifies that confidence intervals of coefficients rather than t-statistics are reported. ^tdec(^#^)^ specifies the number of decimal places reported for t-statistics or for p-values if ^pvalue^ is specified. It also specifies the decimal places reported for R-squared or adjusted R-squared if they are not specified in ^rdec^. The default value for ^tdec^ is usually 2, but 3 if ^pvalue^ is specified. The minimum value is 0, and the maximum value is 11. ^noparen^ specifies that no parentheses be placed around t-statistics or standard errors. ^bracket^ specifies that brackets [] be used rather than parentheses () around t-statistics or standard errors. ^noaster^ specifies that no asterisks denoting 1% and 5% significance levels be reported. ^3aster^ specifies 3 asterisks for 1%, 2 asterisks for 5%, and 1 asterisk for 10% significance levels. ^10pct^ specifies a "+" for 10 significance levels in addition to the default 2 asterisks for 1%, 1 asterisk for 5% significance levels. ^sigsymb(^textlist^)^ specifies symbols for 1% and 5% significance levels (and 10% significance level if ^10pct^ is also chosen). The specified symbols replace the asterisks ** and *. Quotation marks around the new symbols are optional if the characters "," and ")" are avoided. Here are two examples: . ^outreg using table1, sigsymb(^^,+)^ . ^outreg using table1, sigsymb(" (1%)", " (5%)", " (10%)") 10pct^ Omitting symbols will prevent the significance level from being labeled (see also ^noaster^). The following example will display only 1% significance levels: . ^outreg using table1, sigsymb(*)^ 4. Statistics Options --------------------- ^nocons^ specifies that the intercept (constant) coefficient estimate not be reported. ^nonobs^ specifies that the number of observations in the estimation not be reported. ^noni^ specifies that the number of groups in a panel data regression not be reported (e.g. the number of groups specified by the i() variable in @xtreg@). ^nor2^ specifies that no R-squared (or adjusted R-squared) be reported. This option is only meaningful when Stata calculates a true R-squared. ^adjr2^ specifies that the adjusted R-squared be reported rather than the regular R-squared. ^rdec(^#^)^ specifies the number of decimal places reported for the R-squared or adjusted R-squared. The default value for ^rdec^ is the value for ^tdec^. The minimum value is 0, and the maximum value is 11. ^addstat("^text^" , ^# [^, "^text^", ^# ...] ^)^ specifies user-added statistics to be displayed in new lines below the R-squared (if shown). The user must specify both a name and a value for the statistic. Users can report significance levels of test statistics as a second statistic to be shown on the line below the first statistic (see last example below). ^adec(^numlist^)^ specifies the number of decimal places reported for user-added statistics (in ^addstat^). The default value for ^rdec^ is the value for ^tdec^. The minimum value is 0, and the maximum value is 11. If one number is specified in the numlist, it will apply to all statistics. If multiple numbers are specified in the numlist, they are applied to the user-added statistics as in ^bdec^. ^eform^ specifies that the exponential form of the coefficients be reported. This corresponds to the ^or^ option for @logit@, @clogit@, and @glogit@ estimation, ^irr^ for @poisson@ estimation, ^rrr^ for @mlogit@, ^hr^ for @cox@ hazard models, and ^eform^ for @xtgee@, but it can be used to exponentiate the coefficients after any estimation; see ^[R] maximize^ - methods and formulas. ^marginal^ specifies that the marginal effects rather than the coefficient estimates are reported. This is done automatically after @dprobit@. It can be used after @search:truncreg!truncreg,marginal@ from STB 52. ^onecol^ specifies that multiequation models (e.g. @mlogit@, @reg3@) be formatted in one column rather than the default of multiple columns, one column per equation. Also reports extra statistics included in the e(b) vector. ^xstats^ specifies that the extra statistics included in the e(b) matrix be reported. Extra statistics for multi-equation models (i.e. @heckman@, @heckprob@, and @biprobit@) are not reported - use ^addstat^ or ^onecol^. If there are no extra statistics in the e(b) matrix, ^xstats^ is ignored. This option is largely superceded by ^addstat^. 5. Other Options ---------------- ^comma^ specifies that the ASCII file output be separated by commas rather than by tabs. This can cause problems if any of the user-defined text has commas in it (such as variable labels, ^title^, ^ctitle^, ^addstat^, or ^addnote^). ^append^ specifies that new estimation output be appended to an existing output file. In general, the same ^outreg^ options should be used in the original regression output and each appended regression. The notes at the bottom of the table explaining the t-statistics or standard errors and asterisks are correct for the first estimation in the output file. If subsequently appended estimation results use different options (such as a switch to ^noaster^, or change the estimation's ^robust^ option), the notes will not be appropriate for all the columns. This problem can be addressed with a combination of ^nonotes^ and ^addnote^. ^replace^ specifies that it is okay to replace filename if it already exists. Examples -------- . ^regress y x1-x4^ . ^outreg using table1^ . ^outreg x1-x3 using table2, se bdec(4) bfmt(e) tdec(3) nonotes replace^ . ^regress y x1-x3^ . ^outreg using table3, replace^ . ^regress y x1 x3-x5^ . ^outreg using table3, append^ . ^regress y x1-x2^ . ^outreg using table4, title("Three Regression Variants") /*^ ^*/ addnote("", "Run at $S_TIME, $S_DATE", Using data from $S_FN)/*^ ^*/ replace^ . ^regress y x1-x3^ . ^outreg using table4, append^ . ^regress y x1 x3-x4^ . ^test x3 x4^ . ^outreg using table4, append /*^ ^*/ addstat("F test, x3=x4=0", r(F), Prob > F, r(p)) adec(2,3)^ . ^type table4.out^ Three Regression Variants (1) (2) (3) y y y x1 0.686 0.723 -0.388 (4.47)** (3.79)** (0.62) x2 -3.781 -3.809 (25.66)** (22.21)** x3 4.107 57.701 (0.33) (1.84) x4 21.560 (1.86) Constant 1.330 0.224 -45.005 (0.40) (0.05) (1.82) Observations 100 100 100 R-squared 0.99 0.99 0.99 F test, x3=x4=0 1.78 Prob > F 0.174 Absolute value of t-statistics in parentheses * significant at 5% level; ** significant at 1% level Run at 12:10:19, 18 Apr 2000 Using data from xydata.dta . (output of the @type@ command has been lined up for readability) Author ------ John Luke Gallup Center for International Development Harvard University john_gallup@@harvard.edu Also see -------- STB: STB-46: sg97; STB-49: sg97.1; STB-58: sg97.2 Manual: ^[U] 23 Estimation and post-estimation commands^ ^[U] 29 Overview of model estimation^ ^[R] estimation commands^ On-line: help for @est@, @postfile@, @outfile@, @outsheet@, @save@, @search:modltbl!modltbl@;