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

Re: Re: st: create a contingency table

From   Jean-Benoit Hardouin <>
Subject   Re: Re: st: create a contingency table
Date   Wed, 05 Nov 2003 15:24:14 +0100

On Tue, 4 Nov 2003 23:40:52 -0000, Nick Cox <> wrote:
OK Nick,
"contract" is exactly the command I searched.
I want to create a new dataset, not to display a table !! The confusion is due to the french language where "table (french)" means "dataset (english)" and "table (english)" is translated in "tableau (french)". Thank you.

_EITHER_ the same answer

bysort Item? : gen Count = _N
by Item? : gen tag = _n == 1
list Item? Count if tag

If you want just to keep the
table as new dataset:

keep if tag
keep Item? Count


contract Item?

See [R] contract.

I guess I would have suggested that earlier
if I had sensed interest in dataset as result,
rather than table as result.


*   For searches and help try:

Jean-Benoit Hardouin
37, rue Arrachart
41000 Blois
tél : 02 54 45 39 75
email :
*   For searches and help try:

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