.-
help for ^mktab6^
.-

Print table of estimates in comma-delimited format (version for Stata 6.0)
--------------------------------------------------------------------------
    Basic syntax

	^mktab6^ ^(^depvar1 varlist1^)^ ^(^depvar2 varlist2^)^ ... ^(^depvarN varlistN^)^
		[weight] [^if^ exp] [^,^ <options> ]


    Full syntax

	^mktab6^ ^(^[eqname1^:^] depvar1a [depvar1b ... ^=^] varlist1 [^,^ ^noc^onstant]^)^
	    ^(^[eqname2^:^] depvar2a [depvar2b ... ^=^] varlist2 [^,^ ^noc^onstant]^)^
	    ...
	    ^(^[eqnameN^:^] depvarNa [depvarNb ... ^=^] varlistN [^,^ ^noc^onstant]^)^
		[weight] [^if^ exp] [^,^ <options> ]


    Equation syntax

    ^mktab6^ eqname1 [eqname2 ... ] [^,^ <options> ]


    Options

         ^l^og^(^filename[, append | replace]^)^ [^cmd(^cmdname^)^ 
         ^a^ux^(^name[=label][,name[=label] ... ]^)^ 
         ^e^st^(^name[=label][,name[=label] ... ]^)^
         ^f^lag^(^#=label[,#=label ... ]^)^
         ^t^ag^(^string^)^ ^n^oisily ^c^ontinue 
         ^xl^abel ^yl^abel ^t1^title ^t2^title ^b1^title ^b2^title 
         ^pr^ec(#) ^epr^ec(#) ^notit^le ^nobtit^le ^mif(^conditions^)^ 
         ^pl^evels ^onet^ail command_options ]

Description
-----------

^mktab6^ estimates one or more single-equation models, and 
prints the results in comma-delimited format for importation into a 
spreadsheet or word-processor. This facilitates creating tables in 
"journal-article" format, i.e. with standard errors in parentheses below
parameter estimates, significance flagged, and so on.

^mktab6^ estimates each model specified. It then produces a comma-delimited 
table with the dependent variables across the top, the RHS variables (and 
auxiliary parameter and returned estimates results) down the left, and 
the coefficients and standard errors in the cells. Each column corresponds 
to a single model; each row to a single RHS variable.

^if^, ^in^ and weights are supported.

This command has been tested with ^regress^, ^probit^/^logit^ and 
^oprobit^/^ologit^, although it should work with any single-equation 
estimator. At present, time series operators are not supported.

Specification of Models to Run
------------------------------

Models may be specified with the "new" Stata 6.0 multi-equation syntax.
Thus, they can be entered individually, each surrounded by parentheses.
If several models involve the same RHS variables, they can be specified
together, with an equal sign separating the LHS and RHS variables. 
(e.g. (mpg price weight = rep78 foreign) ).

Models may also be created as equations, and mktab6 will accept a list of
equation names. This maintains compatibility with Stata 5.0 multi-equation
syntax.

Options
-------

^log(^filename^)^ is the name of a log file for the results. The usual log 
     options, ^replace^ and ^append^ are valid. If a log file is open and
     this option is specified, then the open log file will remain open for
     any output other than the comma-delimited table (see ^noisily^, below)
     and will be re-opened after the table printed.

^cmd(^cmdname^)^ is the name of the command to run the model. The default 
	is ^regress^.

^aux(^string^)^ is a comma-separated list of auxillary estimates to print
     immediately after varlist and in the listed order, e.g. ^aux(_cons)^,
     optionally with labels, e.g. ^aux(_cut1=Cut One,_cut2=Cut Two)^.  They 
     need not exist for all the estimated models.

^est(^string^)^ is a comma-separated list of returned estimates to print 
     with optional labels (e.g. ^est(N,r2=R Squared)^).

^mif(^conditions^)^ specifies a set of ^if^ conditions that vary across the
	multiple equations. They are combined with the ^if^ condition, if any,
	with an &. Conditions should take the form: 

		^mif(^ [stub : ] cond1 [^\^ cond2 [...]]^)^

	where stub is pre-pended to each of the cond's.  So, for example,
	mif(rep78== : 1 \ 2 \ 3 \ 4 \ 5 ) would apply -if rep78==1- to the
	first equation estimates, -if rep78==2- to the second, and so on.
	You number of mif() conditions specified must match the number of
	equations.

^flag^ specifies a comma-separated list of one or more significance (p) 
     levels, specified as integers, and corresponding symbols. The default is 
     ^flag(1=**,5=*,10=^^)^, which labels p<0.01 with **; p<0.05 with *, and
     p<0.10 with ^^. Flag values must be in ascending order. To suppress
     significance marking, specify ^f(0=*)^.

^tag(^string^)^ is an identifying name that prints in the third column of output
     (e.g. ^tag(Model One)^).

^noisily^ indicates that the individual models should be displayed as they
     are run.  If a log file is open when ^mktab6^ is executed, this
     output will be sent to that log file; the comma-delimited table will
     be sent to the file indicated in the ^log()^ option.

^continue^ indicates that the master row numbers should continue from the
     last invocation of ^mktab6^. This allows creation of a single log
     file with multiple tables, one after the other.

^xlabel^ uses variable labels (if any) to label the RHS variables.

^ylabel^ uses variable labels (if any) to label the LHS variables.

^t1title^, ^t2title^, ^b1title^, and ^b2title^ allow up to two lines of
     titles at the top and bottom of the table.

^notitle^ and ^nobtitle^ suppress printing of the default top and bottom
	title information. This is helpful in conjunction with the ^continue()^
	option.

^prec^ indicates the number of decimals to be printed for coefficients and 
     standard errors. The default is three.

^rprec^ indicates the number of decimals to be printed for returned estimates.
	The default is two.

^onetail^ indicates that one-tailed significance levels should be calculated.
	The default is two-tailed.

^plevels^ indicates that p-levels should be displayed under the coefficients, 
	in place of standard errors.

command_options can include any options appropriate to the command being run
     (e.g. ^robust^).

Output
------

^mktab6^ outputs the following columns:

  1 row number:     consecutive numbering of the lines in the table as a whole,
                    which allow re-sorting into the correct order

  2 line type:      0 for header/title rows
                    1 for coefficients
                    2 for standard errors
                    3 for estimates, and
                    4 for footer rows.
                    These allow re-sorting of the data for formatting

  3 the tag:        Contents of the ^tag()^ option, to identify the table

  4 variable names: The name of the variable for this row (blank for std error
                    rows)

  5+ Alternating columns of coefficients for each model, with significance 
                    symbols for each coefficient. 

Rows alternate between coefficients and their standard errors. Standard 
errors are surrounded by parentheses.

Examples:
--------

     . ^mktab6 (mpg price rep78 = gratio weight), log(mylog)^

        This runs three regressions (with DVs mpg, price and rep78), each 
        with RHS variables gratio and weight (and a constant). It prints the
        coefficients (and their standard errors) into a file called mylog.log.

     . ^mktab6 (vote90 vote92 = dem rep ideology) cmd(probit) ^
       ^aux(_cons=Intercept) est(N,ll=Log Likelihood,r2_p=Pseudo R2)^
       ^tag(Table One) log(mylog, append) continue^

        This runs two probit models (DVs vote90 and vote92), each with three 
        dependent variables (dem, rep and ideology). The table includes 
        coefficients and standard errors for the three RHS variables and the
        constant term (labeled Intercept), as well as estimates N, ll, and r2_p
        (which are labeled "N", "LnL", and "Pseudo R2", respectively.) 
        It appends the table to mylog.log, and numbers the rows consecutively
        with the previous table.

      . ^mktab6 (rep78 mpg price) (rep78 mpg price weight), cmd(oprobit) ^
        ^f(.1=**,1=*) pr(5) log(mylog, replace) xlab ylab ^
        ^a(_cut1=Cut One,_cut2=Cut Two,_cut3=Cut Three,_cut4=Cut Four)^

        This runs two ordered probit models of rep78, one with independant 
        variables mpg and price, the other with mpg, price, and weight. It 
        prints the results with five decimal places, uses the variable labels 
        from the data set, and flags coefficients p<0.001 with ** and 
        p<0.01 with *.

The output from the second example:

	1,0,,Estimates (using oprobit)
	2,1,,Variable,Repair Record,,Repair Record,
	3,1,, ,1978,,1978,
	4,2,,Mileage (mpg),0.11342,**,0.05978, 
	5,3,,,(0.02897),,(0.04091),
	6,2,,Price,0.00010, ,0.00014, 
	7,3,,,(0.00005),,(0.00005),
	8,2,,Weight (lbs.),--, ,-0.00055, 
	9,3,,, ,,(0.00031),
	10,2,,Cut One,0.96916, ,-1.66922, 
	11,3,, ,(0.82655),,(1.68018),
	12,2,,Cut Two,1.83700, ,-0.78752, 
	13,3,, ,(0.79926),,(1.66034),
	14,2,,Cut Three,3.22326,**,0.63996, 
	15,3,, ,(0.82574),,(1.65004),
	16,2,,Cut Four,4.18628,**,1.65129, 
	17,3,, ,(0.87507),,(1.65440),
	18,6,,** p<0.001, * p<0.01, two tailed
	19,7,,

        
Notes
-----
This program is inspired by (and some programming lifted from) Christopher
Ferrell's ^esthold^ and ^estprt^ commands. Code for parsing the multiple
equation syntax was taken shamelessly from the ^reg3^ command - thank you,
Vince Wiggins and Statacorp.

The tag, row number and row type columns can be used to sort the rows in
useful ways once inside the spreadsheet.  For example, sorting on row type,
one would then have blocks of coefficients, standard errors, and results
grouped together, possibly across a large number of tables (different tags).
So one can easily set formatting options for each type (block) of row,
and then resort by tag and row number to return to the orginal output order.  

If you set things up right, however, you should be able to take these results
directly into a word processor and convert the commas to tabs.

The significance calculations are based on e(df_r) containing degrees of 
freedom for t ratios; for models that do not generate e(df_r) (e.g. probit)
the z ratio is used.

Author
------

^Nicholas Winter^
^Department of Political Science^
^Cornell University^
^nwinter@@umich.edu^
