Statalist The Stata Listserver

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

RE: st: duplicating observations

From   "louis boakye-yiadom" <>
Subject   RE: st: duplicating observations
Date   Thu, 27 Apr 2006 12:55:20 +0000

Many thanks for all the suggestions. I wanted to do some tests of association, so the -tabulate- command with the "frequency weight" option does exactly what I wanted. I've learnt a lot from all the comments!


You might like to try the -expgen- command, which is an extended version
of -expand- downloadable from SSC, which sorts the dataset so that the
duplicates  of each observation are side by side, and can optionally add
a new variable giving the sequence number of each duplicate within the
set of duplicates for the same observation. In Stata, use the -ssc-
command to download -expgen-.

I hope this helps.


Roger Newson

-----Original Message-----
[] On Behalf Of SamL
Sent: 26 April 2006 15:43
Subject: Re: st: duplicating observations

As some have said, you can use the -expand- command.  If you only need
expand so you can estimate models, many models allow frequency weights,
which basically do the expansion on-the-fly during estimation.

Hope this helps.

On Wed, 26 Apr 2006, louis boakye-yiadom wrote:

> Dear All,
> Is there a Stata command for duplicating observations? I have a
> dataset, in the sense that it is in a "frequency table" format, but
> interested in converting it into individual level observations. So I
> if there is a way of asking Stata to generate multiple copies of an
> observation, I would be able to have the data in the desired format.
> help will be appreciated. Thanks.
> Louis

*   For searches and help try:

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