Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: New package -xcontract- on SSC

From   Roger Newson <>
Subject   st: New package -xcontract- on SSC
Date   Mon, 04 Aug 2003 17:34:31 +0100

Fellow Statalisters

Thanks to Kit Baum, there is now a new package -xcontract- downloadable from SSC. In Stata, type -ssc desc xcontract- to find out more.

The -xcontract- package is described as below on my website. It is an extended version of -contract-, and is improved in 3 ways. First, it calculates percents. Second, it is byable (calculating percents within by-groups if -by ... :- is specified). Third, it gives the user more choice about the destination of the output data set, with the options of listing it to the Stata log, saving it to a disk file, or writing it to the memory (overwriting the original data set).

Just recently, there have been a few postings on Statalist, indicating that quite a few users could use a package like -xcontract- for creating publication-ready tables of frequencies and percents. The output data set produced by -xcontract- can be converted to a form that can be cut and pasted into a word processor such as Microsoft Word, or into a TeX, LaTeX or HTML document, using the -listtex- package, downloadable from SSC (or in a Stata 7 version from my website). This might be done after reprocessing the output data set using various other packages, such as -tostring- and -ingap- (also downloadable from SSC) and -reshape- (part of official Stata). More about the use of these packages to create publication-ready tables can be found in Newson (2003), due to appear in The Stata Journal, but also downloadable from my website at
either using a browser or using the Stata -net- command.

Best wishes



Newson R. Confidence intervals and p-values for delivery to the end user. The Stata Journal 2003, in press.

package xcontract from

xcontract: Make data set of frequencies and percents on disk or in memory

xcontract is an extended version of contract. It creates a data set with one
observation per combination of values of a list of variables in the existing
data set and new variables containing the frequency and percent of each
combination, and, optionally, the cumulative frequency and percent of each
combination. By-variables can be used with xcontract, and the percents
will then be calculated within by-groups. The output data set may either be
listed to the Stata log, or saved to a disk file, or written to the memory
(overwriting any existing data set).

Author: Roger Newson
Distribution-Date: 04august2003
Stata-Version: 8

INSTALLATION FILES (click here to install)

Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605

Opinions expressed are those of the author, not the institution.

* For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index