Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: FW: How to make 'contract' create a row of zero frequencies?


From   "Pauline Rogers" <Pauline.Rogers@cancer.org.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: FW: How to make 'contract' create a row of zero frequencies?
Date   Mon, 22 May 2006 11:52:09 +0100

Dear All,

I have a large dataset containing information on individuals attending for
screening at several centres.

I am writing a program to summarise monthly attendance, to be run regularly
by one of our administrators.  So I first 'contract' my data to create a new
dataset of the number of attendances for each centre for each month.  I used
the following statement:

contract centre3 mrec, freq(count) zero

(Centre3 = centre code, mrec = month code)

I have discovered that when there are no attendances in a month at any of
the centres, Stata completely excludes this month rather than create a zero
count for each centre.

This then completely throws out my summary statistics.  Is there any way I
can force 'contract' to create a count of zero for each centre for any month
with zero attendance at all centres?

Thank you

Pauline

Pauline A Rogers MSc CStat (Mrs)
Statistician
Cancer Research UK
Colorectal Cancer Unit
St Mark's Hospital
Northwick Park
Harrow
Middx
HA1 3UJ

Tel: 	020 8235 4256

Fax:	020 8235 4277 


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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