help corrtex -------------------------------------------------------------------------------

Title

corrtex -- Generates a correlation table in LaTeX

Syntax

corrtex varlist [if] [in] [weight] , file(filename) [options]

options Description ------------------------------------------------------------------------- File file(filename) specifies the name of the file in which the output is to be stored append appends the code to the specified file replace overwrites any existing file with the same name

Table format digits(#) defines the number of digits to be displayed landscape generates a landscape format table longtable allows to create tables that span over several pages sig displays the significance of each correlation casewise causes the table to reflect casewise deletion nbobs displays the number of observations under each correlation placement(string) specifies the placement of the table title(string) defines the table title key(string) defines the table label na(string) allows to define the content of cells where a numerical value has no sense

Output noscreen Don't display the correlation table in the Result window

------------------------------------------------------------------------- by is allowed; see prefix.

Description

corrtex produces a correlation table in LaTeX format. This command is inspired by mktab and outreg commands, and its code heavily borrows from mkcorr and sutex commands. This command offers a number of advantages such as allowing the use of labels, controlling the number of decimal places used, and other LaTeX specific formatting options.

Options

+------+ ----+ File +-------------------------------------------------------------

file(filename) specifies the name of the file in which the output is to be stored. The output file, filename.tex, can be included directly in a LaTeX document. If the user specifies a file name that includes an extension, that extension will be used rather than .tex. The filename specification may include the path of a directory other than the current working directory.

append appends the code to the specified file. This option can not be used in conjunction with replace.

replace overwrites any existing file with the same name. This option can not be used in conjunction with append.

+--------------+ ----+ Table format +-----------------------------------------------------

digits(#) defines the number of digits to be displayed (default is 3).

landscape generates a landscape format table.

longtable allows to create tables that span over several pages using the "supertabular" package (do not forget to \usepackage{longtable} in the preamble of your .tex document)

na(string) allows to define the content of cells where a numerical value has no sense (for example a Std. Dev. for only one observation). ATTENTION : do not use the following characters # $ % & ~ _ ^ \ { } in that option.

sig requests that the significance of each correlation be printed under it.

casewise causes the table to reflect casewise deletion. In other words, results will reflect only those observations for which no listed variables are missing. This command will yield results identical to using corrrelate. The default is to engage in pairwise deletion, yielding results identical to using pwcorr.

nbobs displays the number of observations under each correlation.

placement(string) specifies the placement of the table in the .tex doc (default is htbp)

title(string) defines the table title (Cross-correlation table is default).

key(string) defines the table label (corrtable is default).

+--------+ ----+ Output +-----------------------------------------------------------

With the noscreen option, the correlation table is not displayed in the Result window.

Examples

. webuse auto2yr

. corrtex price mpg, file(auto)

. corrtex price mpg if price>5000, file(auto) replace case sig dig(4) nb

. bysort foreign : corrtex price mpg, file(auto) replace longtable title(Cross-correlations)

Author

Nicolas Couderc, Reims Management School and Université Paris 1 (Panthéon - Sorbonne), couderc@univ-paris1.fr

Questions, comments and bug reports are welcome.

Acknowledgements

This program owes a debt to mktab, outreg, corrtab and specially mkcorr (by Glenn Hoetker) and sutex (by Antoine Terracol).

Also see

On-line: help for correlate and pwcorr.