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

Re: st: adding observations


From   Daniel Egan <[email protected]>
To   [email protected]
Subject   Re: st: adding observations
Date   Thu, 9 Dec 2004 14:48:01 -0500

Dave asked
On Thu, 9 Dec 2004 14:34:13 -0500 (EST), David K Evans
<[email protected]> wrote:
> I have a dataset of campaign contributions, with observations at the level
> of each individual contribution. I want to generate a dataset in which the
> unit of observation is the donor-year. But if I use 'egen' to generate
> donor-year means, those donors who didn't give in a particular year will
> not appear at all. I want them to appear as zeros. Is there any way to add
> these observations?

the -fillin- command seems like it would work, i.e.

fillin donor year
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index