看outreg2的help中的例子,命令格式是不能自己猜的。
这个命令选项不是,所以你的看帮助文件
Example 0. Basic game plan
You should specify the current directory where all the files will be stored. Alternatively, you can
specify the complete pathway from within outreg2, but you must encase it with quotations marks.
cd c:\
sysuse auto,clear
regress mpg foreign weight headroom trunk length turn displacement
outreg2 using myfile, replace cttop(full)
regress mpg foreign weight headroom
outreg2 using myfile, see word excel tex dta
You can immedicately see the changes. The variable "weight" loses some of its significance in the full
specification. The estimated effect of weight can be shown to be downward-biased from -0.00420 to
-0.00647 by omitting a number of covariates. This is an easy way to check for collinearity and
misspecification.
You can use e( ) or addstat( ) option to augment the standard regression results with other e-class
statistics (scalar only). addstat can handle r-class and s-class results as well, if they exist. The
following codes are equivalent excpet in appearance.
outreg2 using myfile, e(r2 ll)
outreg2 using myfile, addstat(R-squared by hand, e(r2), Log Lik, e(ll))
If you want to see everything available in the e-class, do it like this:
outreg2 using myfile, e(all)
Example 1. Prefix and -bys:-
outreg2 can be used in as a prefix.
sysuse auto, clear
outreg2 using myfile, replace ti(Car stuff): reg price mpg weight turn
outreg2 using myfile, see excel: reg price mpg weight turn if price > 6100
It is also byable with -bys:- prefix.
bys foreign: outreg2 using myfile, side replace see: reg rep78 head weight gear length turn [aw=mpg]
Example 2. Running loops
Because this involves a loop, you must copy and paste into a do-file:
sysuse auto,clear
cap erase myfile.txt
forval num=1/5 {
regress mpg weight headroom if rep78==`num'
outreg2 using myfile
}
seeout
Alternatively, make use of macro
local replace replace
forval num=1/5 {
regress mpg weight headroom if rep78==`num'
outreg2 using myfile, `replace'
local replace
}
Example 3. Stored estimates
You can automatically recall the stored estimates by specifying them from within outreg2. To
distinguish them from the varlist, place the estlist within a pair of [square brackets].
sysuse auto,clear
regress mpg foreign weight headroom trunk length turn displacement
est store Full
regress mpg foreign weight headroom
est store Restricted1
regress mpg foreign weight
est store Restricted2
outreg2 [Full Restricted1 Restricted2] using myfile, replace see
outreg2 will take the stored estimates as wildcards (*). Try this:
outreg2
using myfile, see replace
outreg2 [R*] using myfile, see replace
The varlist may be combined with the estlist. The varlist will take the wildcards as well, provided
they exist in the estlist.
outreg2 foreign weight using myfile, see replace
If you are specifying the varlist, you must make certain the desired varlist exists in all the stored
estiamtes. Since not all equations may contain the specified varlist, it is usually a poor idea to
combine the one column option with the varlist.
Example 4. Shorthand
outreg2 will remeber the last set of options you specified until the end of the day. The stored command
will expire at mid-night to prevent the possible loss of finished table by inadvertantly writing over a
finished file. The following shorthand should be tried separately.
outreg2
outreg2, replace
outreg2, seeout
The following two options are excluded from the stored command: seeout and replace. These two must be
specified each time you invoke outreg2 through the shorthand. To change the stored options, you must
invoke the full syntax with the specified using file (i.e. outreg2 using myfile, etc). The varlist and
the stored estimates names are not stored with the command.
For someone who is in a hurry, outreg2 will take the following syntax, provided the desired options
have been stored by invoking them in the full syntax. The varlist and/or the estlist are still allowed
under this syntax. This pre-command syntax is made available for the benefit of iterative users.
outreg2 : reg mpg foreign weight headroom
outreg2, replace : reg mpg foreign weight headroom
outreg2
seeout
Example 5. Decimal places
By default the regression coefficients are shown with auto-digits, but a user may wish to specify their
own number of decimals places. We could use the option dec(5) to display 5 decimal places for all
statistics or bdec(5) for just the coefficient, sdec(5) just for standard error, etc.
outreg2 using myfile, replace auto(4)
outreg2 using myfile, dec(5)
outreg2 using myfile, bdec(5) bfmt(f) sdec(7) sfmt(e) see
Example 6. Sideway display
Medical journals often requires the displays to go sideways. Use sideway to make this happen. sideway
is compatible with stats( ).
outreg2 using myfile, sideway stats(coef aster se) noparen dec(3) replace
Note the above code is equivalent to building the table one column at a time like this:
outreg2 using myfile, stats(coef) replace noparen dec(3)
outreg2 using myfile, stats(aster) noparen dec(3)
outreg2 using myfile, stats(se) noparen dec(3)
Some journals often prefer t-statistics to standard errors and don't use asterisks to denote
statistical significance. Some people use brackets. The title( ) option requires quotation marks when
it contains a comma. Note that dec decimal option apply to both the coefficients and the standard
errors.
regress mpg foreign weight
outreg2 using myfile, tstat bracket noaster title("No standard errors!")
seeout
Example 7. Summary tables
Use sum to place summary statistics into a table. The sample mean and the standard deviation for the
sample used in the earlier regression will be automatically displayed.
* After estimation
sysuse auto, clear
reg mpg price rep weight length
outreg2 using myfile, sum replace
outreg2 using myfile, see
* Regular summary table
* note: version 11 and above requires clear* to prevent mismatch between e(b) and e(sample)
clear*
sysuse auto, clear
outreg2 using myfile, sum(log) replace eqdrop(N mean) see
outreg2 using myfile, sum(detail) replace eqkeep(N max min) see
outreg2 using myfile, sum(detail) replace see
Example 8. Drop/keep/order variables
Specifying a varlist can be convenient to limit the output table to only the essential coefficients.
For example, we may want to control for the influence of dummy variables, but not report their
estimated coefficients.
sysuse auto, clear
tab rep78, gen(repair)
regress mpg foreign weight repair1-repair4
outreg2 weight foreign using myfile, drop(repair*)
Alternatively, keep( ) and drop( ) can be used to control the displayed variables. Use nocons to drop
constants.
outreg2 using myfile, drop(repair*) replace
outreg2 using myfile, keep(mpg foreign)
outreg2 using myfile, nocons
seeout
There are several ways to order variables in the output. The first is to order them when running
regression. The second way is to specify varlist from within outreg2. Or you might try sortvar( ) or
groupvar( ).
* single equation
reg mpg rep78 head trunk weight
outreg2 using myfile, replace sortvar(trunk turn)
reg mpg rep78 head weight turn disp gear
outreg2 using myfile, sortvar(trunk turn) see
* multiple equations
reg3 (mpg rep78 head trunk weight) (head trunk weight rep78 gear)
outreg2 using myfile, replace long
reg3 (mpg rep78 head weight turn disp ) (mpg rep78 head trunk weight gear)
outreg2 using myfile, sortvar(trunk turn) see long
* groupvar( ) will create super-rows
reg mpg rep78 head trunk weight
outreg2 using myfile, replace
reg mpg rep78 head weight turn disp gear
outreg2 using myfile, groupvar(Group1 trunk turn head weight Group2) see
Example 9. Adding r( ) e( ) scalars
Additional statistics may be added with addstat( ) or addtext( ). Values stored in macros r( ), e( ),
or s( ) can be included directly. You can see what values are available by typing ereturn list or
return list.
To test the equality of two of the estimated coefficients and report the results in the table, note
that test will sometimes return chi-squared, then you would instead use addstat(chi-square test,
r(chi2)):
reg mpg foreign weight length
test foreign length
outreg2 using myfile, adds(F-test, r(F), Prob > F, `r(p)') replace
seeout
To add results of lincom postestimation command to a table:
sysuse auto, clear
reg price mpg rep78 head
lincom mpg + rep
local tstat=r(estimate)/r(se)
local pval = tprob(r(df), abs(`tstat'))
outreg2 using "myfile", adds(joint, r(estimate), t-stat, `tstat', p-val,`pval') replace see
In some cases it is better to save the value of a previously calculated statistic in a local macro and
then put that into addstat( ):
regress mpg rep78 headroom
test rep78
local F1 = r(F)
test headroom
outreg2 using 2test, addstat(Test1 F, `F1', Test2 F, `r(F)')
If it is missing, outreg2 will automatically calculate e(p), which is presumably the F-test or
chi-square-test of significance of a regression.
outreg2 using myfile, addstat(F test, e(p))
Another example would be to report a pseudo R-squared after a logit estimation, which outreg2 does not
otherwise report.
logit foreign price trunk weight
outreg2 using myfile, addstat(Pseudo R-squared, `e(r2_p)')
Example 10. Odds ratios and exponentials
Odds ratios are exponential transformations of coefficients. As noted above, there is no way of knowing
after an estimation command if the user chose to report the exponentiated form of coefficients. The
user must choose the eform option in outreg2 to get the same form of the coefficients displayed by the
estimation into the outreg2 table.
For duration models, the exponential form is known as the hazard ratio. For other models it is known as
odds ratio, relative risk ratio, or incidence rate ratio.
sysuse auto,clear
logit foreign price mpg rep78, or
outreg2 using myfile, replace cti(raw)
outreg2 using myfile, eform cti(odds ratio) see
* Alternatively:
outreg2 using myfile, stnum(replace coef=exp(coef), replace se=coef*se) cti(odds ratio) see
Note that coef was first transformed, then used to calculate se in the example above.
Example 11. Marginal Effects
mfx option can be used to report marginal effects after mfx command has been applied.
sysuse auto, clear
logit foreign mpg rep78 head
mfx compute
outreg2 using myfile, replace
outreg2 using myfile, mfx ctitle(mfx) see
margins will report it as well.
sysuse auto, clear
logit foreign mpg rep78 head
margins, dydx(_all) post
outreg2 using myfile, ctitle(margins) see
For multiple outcomes, you may want to use mfx2 by Ricahrd Williams or margeff by Tamas Bartus. They
are both available from ssc.
margeff example:
sysuse auto, clear
mlogit rep turn mpg price
margeff, at(mean) replace
outreg2 using myfile, cttop(margeff) see replace
mfx2 runs a little slower:
sysuse auto, clear
mlogit rep turn mpg price
mfx2, replace
outreg2 using myfile, long cttop(mfx2) see replace
The marginal effects reported by dprobit, dlogit2, dprobit2, and dmlogit2 are automatically reported by
outreg2.
Because truncreg, marginal, and dtobit report both regression coefficients and marginal effects, the
user must specify the margin option for outreg2 report the marginal effects.
dtobit, on the other hand, calculates three different marginal effects. The user must specify which
marginal effect, the unconditional, conditional, or the probability uncensored, to be reported. Note
that "version 6" must be set for dtobit to work.
version 6: tobit mpg trunk weight, ll(17)
version 6: dtobit
outreg2 using myfile, margin(u) ctitle(Unconditional) nor2 replace
outreg2 using myfile, margin(c) ctitle(Conditional) nor2
outreg2 using myfile, margin(p) ctitle(Probability) nor2 see
Example 12. Word or Excel files
Use word or excel for automatic generation of Word/Excel files:
reg price mpg rep78 headroom trunk weight
outreg2 using myfile, word excel replace
Follow these directions for manual conversions from .txt files:
In MS Word, open or insert the file created by outreg2. Select the estimation text that is in columns
(not the notes at the bottom of the table or the title at the top, if any), and choose Table, Convert
Text to Table.
To shift the table within MS Word, highlight the entire table, choose Table Properties (go the top
menu, drag down on the Table option), and then click the alignment as Left instead of Center.
In Excel, open the file created by outreg2 and follow the default choices in the Text Import Wizard (if
you do not see the file, choose All Files as the File Type). Prevent the conversion of the parenthesis
into a negative number (an accounting convention) by doing the following: 1. import it as "Delimited",
2. choose Tab as the Delimiters, and 3. Choose "Text" as Column data format after Highlighting all the
columns by shift-down, right-clicking.
To export the .xml table to a word processor, you should separately copy the table and the notes at the
bottom of the table (prevents the notes from taking up too much space). You can avoid this problem by
opening the .txt file manually from inside MS Excel, as detailed earlier, or copy and paste the notes
into another cells in MS Excel, which will cause them to be displayed properly.
To get rid of "green tabs" in Excel: From inisde Excel, Tools > Options > Error Checking. When you get
there, uncheck "Number stored as text". No more green triangles.
You can also use Stat/Transfer if you have one. Choose ASCII-Delimited as the input file and choose
Excel as the output file. You will need to adjust the column widths from inside Excel.
Example 13. TeX files
LaTeX compatible table can be created with tex option. With the use of free conversion software, such
as MiKTeX, you can create Adobe PDF files of the finished tables directly within Stata by invoking a
shell command.
regress mpg foreign weight
outreg2 using myfile, tex replace
Free TeX-to-PDF conversion software are available, such as the MiKTeX (www.miktek.org) for Windows or
teTeX (www.tug.org/teTeX/) for Unix/Linux. They can be invoked with a shell command:
!texify -p -c -b --run-viewer myfile.tex {using MiKTeX on Windows)
!pdflatex myfile (using teTeX on Linux)
outreg2 cannot append TeX format tables to one another, so regressions must be appended in ASCII form
until the last regression, which is appended with the tex option.{_end}
The base font point size of tex in a TeX table can be specified with the tex( ) parameter. TeX only
allows font sizes of 10 and 11 points besides the default of 12 point. The texfrag option creates a TeX
fragment for inclusion in a larger TeX document. For example, a TeX fragment table from the first
regression above could be created with
outreg2 using myfile, tex(frag)
and then be included in the following TeX document with the \input{myfile} command:
\documentclass[10pt]{article}
\begin{document}
... text before inclusion of table myfile.tex ...
\input{myfile}
... text after inclusion of table myfile.tex ...
\end{document}
Technical Note: Non-alphanumeric characters often have special meaning in TeX, namely _, %, #, $, &, ~,
^^, \, {, }. To print them like any other character, include a \ in front of the character. outreg2
automatically does this for the first two, _ and %. You can include the other characters in titles,
variable labels, or notes if you preceed them with with a \ in the Stata text. The exception is \
itself; \ must be replaced with $\backslash$ to render properly in TeX.
In addition, in TeX the characters <, >, and | will only appear as themselves in math mode, so they
must be written as $<$, $>$, and $|$.
TeX codes can be inserted into outeg2 titles, variable labels, and added notes. This requires
understanding TeX formatting codes. The example below creates a Greek letter chi with a squared
exponent for a chi-squared test statistic.
outreg2 using myfile, addstat($\chi^2$, 22.1) tex
Note that outreg2 will automatically convert < or > but not chi^2.
outreg2 using myfile, addstat(LR $\chi^2$, e(chi2), Prob < $\chi^2$, e(p)) tex
outreg2 automatically converts _ to \_, except when it finds two $'s in the text, in which case it
assumes the _ is a subscript designator in a TeX inline equation. That means that if you want to add
text that includes an inline equation, but you really want the _ to appear as such in the TeX table,
you must replace it with a \_.
Stata will interpret $ immediately followed by a letter as a global macro. To get Stata to output a
literal $, insert an escape character "\" like this: \$. R-squared, for example, must be "\$R^2$"
rather than "$R^2$" because $R would be evaluated as the value of global macro R.
Putting a literal "$" in TeX output can be confusing: to get "$US" in the TeX output, for example, one
needs "\$US" in the TeX input file, which requires "[url=]\\\$US[/url]" in Stata text, because Stata resolves "\\"
into "\" and "\$" into "$".
A final quirk: you cannot use the results of the Stata macro $S_FN in outreg2 text for a TeX table if
you use Microsoft Windows. $S_FN returns the path name for the current data file which in Windows
includes \ characters which will prevent the TeX table from rendering properly.
Example 14. Adding column titles or notes
You can add a column title "Base case (mpg)" to distinguish this regression from a second regression.
No quotation marks are required around the column title because it does not contain commas. Use cttop(
) to add additional column title to the default column titles.
outreg2 using myfile, replace ctitle(Base case (mpg))
outreg2 using myfile, cttop(On top)
You can add explanatory note at the bottom of a column using the addnote option. Note that since the
text in addnote does not contain parentheses or commas it does not need quotation marks.
outreg2 using myfile, addnote(Dummy variables not shown)
addnote for inserting a blank line, followed by the time the program was run (from the built-in Stata
functions $S_TIME and $S_DATE), and the dataset used by the estimation (from the Stata function $S_FN).
regress mpg foreign weight length
outreg2 using myfile, addn("", "Time $S_TIME, $S_DATE", Data from $S_FN) replace
Example 15. n-way cross-tabulation
n-way tabulation likes of which are also produced by tab3way or table. It will take about a minute to
run.
* Prepare data
sysuse auto, clear
egen mileage=cut(mpg), group(10)
egen paid=cut(price), group(3)
egen heavy=cut(weight), group(3)
* 3-way cross-tabulation sideway
outreg2 mileage paid heavy using myfile, see replace cross side
* 5-way cross-tabulation without percentage
outreg2 mileage paid foreign rep78 heavy using myfile, see replace cross stats(coef)
Example 16. Group summary table
sysuse auto, clear
gen white=cond(uniform( )>.5,1,0)
gen black=cond(white==1,0,1)
gen male=cond(uniform( )>.5,1,0)
gen female=cond(male==1,0,1)
* do it with -bys:-
bys male black: outreg2 using myfile, sum(log) eqkeep(mean N) drop(white female male black) excel
replace
* do it by hand
outreg2 using myfile if white==1 & male==1, sum(log) eqkeep(mean N) cttop(white, male) drop(white
male female) excel replace
outreg2 using myfile if white==1 & female==1, sum(log) eqkeep(mean N) cttop( , female) drop(white
male female) excel
outreg2 using myfile if white==1, sum(log) eqkeep(mean N) cttop( , total) drop(white male female)
excel
outreg2 using myfile if black==1 & male==1, sum(log) eqkeep(mean N) cttop(black, male) drop(white
male female) excel
outreg2 using myfile if black==1 & female==1, sum(log) eqkeep(mean N) cttop( , female) drop(white
male female) excel
outreg2 using myfile if black==1, sum(log) eqkeep(mean N) cttop( , total) drop(white male female)
excel
Example 17. Fixed effects or legends
Two-way fixed-effects estimation with dummy indicators:
* set up data
sysuse auto, clear
ren rep78 state
ren turn id
keep id price mpg weight state
tab state, gen(ST)
* regress and report
xtreg price mpg weight ST*, fe i(id)
outreg2 using myfile, replace drop(ST*) addtext(State FE, YES, Year FE, YES)
xtreg price mpg weight ST*, fe i(id)
outreg2 using myfile, drop(ST*) addtext(State FE, NO, Year FE, YES)
reg price mpg weight ST*
outreg2 using myfile, drop(ST*) addtext(State FE, NO, Year FE, NO)
* legend
outreg2 using myfile, st(str(Coef) str(Stn Err) str(Spearman)) noparen ct(Legend) replace
outreg2 using myfile, st(coef se spearman blank)
Example 18. Stats transformation/manipulation
The contents of stats( ) can be manipuated with standard Stata commands.
Use stnum( ) to work with numerical forms.
* multiply by 100
sysuse auto, clear
reg mpg price weight
outreg2 using myfile, replace
outreg2 using myfile, stats(coef se) stnum(replace coef=coef*100, replace se=se*100)
* exponentiate both coef and se
outreg2 using myfile, stats(coef se) stnum(replace coef=exp(coef), replace se=coef*se)
* absolute value of t-statistics
outreg2 using myfile, stats(coef tstat) stnum(replace tstat=abs(tstat))
Use ststr( ) to apply string operations.
* add dollar-sign ($) for the mean of price
reg mpg price weight
outreg2 using myfile, stats(mean) ststr(replace mean="$"+mean if varname=="price") replace
* add "max" to maximum and "min" to minimum
outreg2 using myfile, stats(max min) ststr(replace max="max "+max if max~="", replace min="min "+min
if min~="")
Use stnum( ) and ststr( ) together.
* multiply by 100 and add percent (%) sign
outreg2 using myfile, stats(mean) stnum(replace mean=mean*100) ststr(replace mean=mean+" %" if
mean~="")
* You can automate this process by writing your own programs and inserting them like this:
prog drop _all
prog define percent
replace mean=mean*100
end
prog define symbol
replace mean=mean+" %" if mean~=""
end
outreg2 using myfile, stats(mean) stnum(percent) ststr(symbol)
* To manipuate string based on numerical content, generate a numerical copy in stnum( ):
outreg2 using myfile, stats(mean) stnum(gen temp=mean) ststr(replace mean="Positive" if temp>0)
* To concatenate (currently works only with major statistics, i.e. coef, se, tstat, etc.:
outreg2 using myfile, stats(coef) ststr(replace coef=coef+" "+se) noaster
Example 20. Insert r-class cmd( ) outputs
You can insert output from r-class command in the table body through cmd( : ) sub-option. Indep and
dependent variables will be fed to them.
* outputs Kendall's tau-a and tau-b
sysuse auto, clear
reg rep78 headroom length turn gear_ratio
outreg2 using myfile, replace stats(corr, spearman, cmd(r(tau_a): ktau), /*
*/cmd(r(tau_b): ktau))
* double-check
ktau rep78 headroom
ret list
Write and insert your own r-class output
You can write your own r-class program and insert their outputs. A scalar should be returned on two
inputs: independent variable and dependent variable. It needs to accept [if] syntax. c_local programs
will work, too, but there might be a conflict.
* r-class program that calculates coefficient of variation
cap prog drop coefvar
prog define coefvar, rclass
syntax varlist(max=2) [if]
gettoken dep indep : varlist
qui sum `indep' `if'
local variation=`r(sd)'/`r(mean)'*100
ret scalar variation=`variation'
end
* test your r-class program
sysuse auto, clear
reg rep78 headroom length turn gear_ratio
coefvar rep78 headroom if e(sample)
ret list
* run them
sysuse auto, clear
reg rep78 headroom length turn gear_ratio
outreg2 using myfile, replace stats(coef, se, sd, cmd(r(variation): coefvar))
* return c_local instead of r-class scalar
cap prog drop coefvar2
prog define coefvar2
syntax varlist(max=2) [if], [proportion]
gettoken dep indep : varlist
qui sum `indep' `if'
local hundred 100
if "`proportion'"=="proportion" {
local hundred 1
}
local variation=`r(sd)'/`r(mean)'*`hundred'
c_local variation=`variation'
end
* run them
sysuse auto, clear
reg rep78 headroom length turn gear_ratio
outreg2 using myfile, stats(coef, se, sd, cmd(variation: coefvar2, proportion))
Send one to the e-mail address below
Programs like these can made into a sub-option for inclusion the future versions. Please note that it
should be something of interest to other people.
-----------------------------------------------------------------------------------------------------------------
Different versions of outreg and outreg2
outreg2 will work under different versions of Stata:
Stata 11.0: seeout will require an additional keyboard hit before moving on
Stata 8.2: full functionality
Stata 8.0: reported stored estimates will be left behind when they are specified
Stata 7.0: no stored estimated
no colon character ":" in your file path; use -cd- instead
Shorthand syntax for outreg2 or seeout will not work in versions earlier than 8.0.
tfmt(.), rfmt(.), pft(.), afmt(.) do not work
cmd( ) and str( ) do not work; stnum( ) or ststr( )?
Other limitations may exit exist; best not to try anything complicated
Compared to the original outreg, outreg2 implements the following as the default: append, 3aster,
coefastr, se, and nolabel. 2aster and tstat provide the access to the old default options. sigsymb is
replaced with symbol. xstats is not supported.
The auxiliary statistics (standard error, etc) are no longer reported in absolute values. The levels of
significance are strictly less than the values (used to be less than or equal to). bdec and bfmt no
longer take multiple inputs.
The embedded spaces in the folder names are now accepted. title(list) can be added anytime. The .out
extension is phased out in favor of .txt extension. A new file will be created if it did not exist.
The past restrictions on the number and the size of variable names have been generally expanded to the
system limit.
The newly available features are the access to label, e(ereturn scalars), automatically formatted
digits by auto(integer) and less(integer), alpha(numlist) provides user-defined test of hypothesis,
seeout calls up the pop up table in the data browser view, the choice of equation names as wide or
long, the converted tables in word, excel, and tex with the shellout commands for them placed on the
screen.
The [estlist], which is a list of stored estimates, is accepted with or without wildcard abbreviations.
The shorthand syntax with a limited option can now be implemented as an independent command following a
regression command, or as a pre-command preceeding it.
The seeout shell is also placed on the screen. The seeout command will work only after outreg2. A
majority of options should work with 8.2. The shell commands were designed with a Windows XP/NT. They
will not work on non-Windows platforms.
How to report a possible error
1. it's best if you send an example using -sysuse- or -webuse- data
2. create a trace log file containing the error
3. Send them to whoever wrote the thing and ask nicely.
cap log close
log using mylog.txt, text replace
which outreg2 /* or whatever command you are dealing with */
cret list
sysuse auto, clear /* or whatever data you are using */
reg rep78 trunk turn foreign /* or whatever you are doing */
set trace on
outreg2 using myfile, replace /* or whatever that gets you the error */
log close
Acknowledgements
codes from pcorr2 by Richard Williams have been incorporated for stats( ) suboption.
Author
Roy Wada
roywada@hotmail.com
based on the earlier works by
John Luke Gallup
john_gallup@alum.swarthmore.edu
Thanks to Kit Baum for advice and providing access to John's later works. I also thank those who have
reported errors, making it possible to fix them in timely fashion.
Also see
STB: sg97 (STB-46, STB-49, STB-58)
Manual: [U] Estimation and post-estimation commands
[U] Overview of model estimation
[R] Estimation commands
Online: est, postfile, outfile, outsheet, save, modltbl, desrep