Statalist The Stata Listserver


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

RE: st: duplicating observations


From   "louis boakye-yiadom" <louisby@hotmail.com>
To   statalist@hsphsun2.harvard.edu
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!

Louis


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


Roger Newson


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of SamL
Sent: 26 April 2006 15:43
To: statalist@hsphsun2.harvard.edu
Cc: SamL@demog.berkeley.edu
Subject: Re: st: duplicating observations

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

Hope this helps.
Sam

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

> Dear All,
> Is there a Stata command for duplicating observations? I have a
summarised
> dataset, in the sense that it is in a "frequency table" format, but
I'm
> interested in converting it into individual level observations. So I
reckon
> 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.
Any
> help will be appreciated. Thanks.
>
> Louis
>

*
*   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