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: assymetric start and end dates in a panel dat set
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: assymetric start and end dates in a panel dat set
Date
Thu, 24 May 2012 09:17:25 +0100
Please don't send attachments! This is explained in the FAQ.
By excel I presume you mean "MS Excel". Evidently you use it but many
Stata user-programmers emphatically do not. I don't want to look at
your spreadsheet files, thanks.
When I said "Look at -egen- for functions to count missings, or
non-missings, in observations or rows." I presumed that was enough of
a clue for you to identify the functions -rowmiss()- and
-rownonmiss()-.
After a -tsfill- you could do something like
egen nonmiss = rownonmiss(Greece Italy UK)
and then your analysis would be conditional
... if nonmiss == 3
No doubt you would have more countries and the number would not be 3.
Nick
On Thu, May 24, 2012 at 9:02 AM, loggyedr salvez
<[email protected]> wrote:
> Thank you Nick. Suppose that I correct the problem and that I have
> observations every 4 weeks for all countries. Thus, I could apply the
> code you proposed-floor(/28)]. The problem is that I have different
> start and end dates and different time periods across countries.
> For example
> startdate-enddate
> Greece 02/11/06-09/10/09
> Italy 07/12/06-06/11/09
> UK 09/11/06-06/11/09
>
> How should I handle this asymmetry? I Would be grateful to you if
> you could provide more information about which functions for –egen-
> to look at. Any proposed coding is also welcomed as I am a new stata
> user and I have difficulty with coding. For example your proposed
> coding
>
> gen edate2 = floor(edate1/28)
> tsset identif2 edate2
>
> was extremely helpful. Should I upload an example of the excel file I
> have to take a look?
>
>
> Thank you for your time,
> stefanos
>
>
> On 5/24/12, loggyedr salvez <[email protected]> wrote:
>> Thank you Nick. suppose that I correct the problem and that I have 4
>> -weekly observations. Thus, I apply the code you proposed-floor(/28)]floo.
>> The problem still remains as I have different start and end dates and
>> different time periods across countries. I would be grateful to you if you
>> could give some more information as well as for the functions egen. I am a
>> new stata user and I have some difficulty moving my work ahead.
>>
>> Thank you again
>>
>> On Wed, May 23, 2012 at 9:06 PM, Nick Cox <[email protected]> wrote:
>>
>>> The answer to this question is surely based on the answer to your
>>> previous question. -tsset- in terms of a time variable that jumps
>>> every 28 days. Look at -egen- for functions to count missings, or
>>> non-missings, in observations or rows.
>>>
>>> Nick
>>>
>>> On Wed, May 23, 2012 at 8:59 PM, loggyedr salvez
>>> <[email protected]> wrote:
>>>
>>> > I have a panel data set that refers to interest rates over time
>>> > accross countries.
>>> > I have observations every 4 weeks. For example
>>> >
>>> > November 1, 2009
>>> > November 29, 2009
>>> > December 27, 2009
>>> > January 31, 2010
>>> > November 1, 2009
>>> > November 29, 2009
>>> > December 27, 2009
>>> > January 31, 2010
>>> >
>>> >
>>> > The problem is that the start and the end date across countries is
>>> different.
>>> >
>>> > For example
>>> > startdate-enddate
>>> > Greece 02/11/08-09/10/11
>>> > Italy 07/12/08-06/11/11
>>> > UK 09/11/08-06/11/11
>>> >
>>> >
>>> > and furthermore as you can see the time interval is not the same for
>>> > all the countries (compare the time span of UK with that of Italy)
>>> > is there any solution to this problem? I want to regress interest
>>> > rates on other variables and if I do not know how to solve this
>>> > problem I might end up having wrong results. If I have to trim the
>>> > dates to obtain symmetry what would be the code for converting this
>>> > series of dates to numeric variable ( I am referring to format time
>>> > %d, tsset identifier time and so forth)
*
* 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/