Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Merging/summing daily values across time periods in (unbalanced) panel dataset


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Merging/summing daily values across time periods in (unbalanced) panel dataset
Date   Wed, 9 Mar 2011 01:47:12 +0000

I see no information on identifiers in your daily dataset.

Nick

On Tue, Mar 8, 2011 at 10:15 PM, Amanda Dwelley <[email protected]> wrote:

> I'm looking for suggestions on how to join and sum daily x values from one
> dataset into time periods defined by a start date and end date in another
> (panel) data set.
>
> Master data set looks like:
> id date_from date_to
> 1 07apr2009 09jun2009
> 1 10jun2009 03jul2009
> 2 13jun2009 10jul2009
> 2 11jul2009 05aug2009
> (~50,000 observations; time periods at irregular intervals)
>
> Daily data looks like:
> date x1 x2
> 02jun2009 5.7 0
> 03jun2009 2.3 0
> 04jun2009 0 2
> 05jun2009 0 3.5
> (3 yrs of daily values)
>
> As you can see the using data could be in wide or long format.
> If I merge the wide format daily data into the master dataset, is there any
> way to reference/look for the dates in variable names that are between the
> start/end date, and sum associated variables? If using the long format of
> the daily data, is there a way to sum values between start/end dates during
> a join or merge?
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index