Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
Nick Cox <njcoxstata@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Getting the 'egranger' command to use the entire sample |

Date |
Thu, 16 Aug 2012 20:36:50 +0100 |

In addition to Mark's authoritative reply -- he is the author of -egranger- -- I would assert that there are no puzzles evident here. -tsset- does not cut out observations; it merely registers what you tell it and makes that information available to programs that need information on the structure of your time series. Plain regressions play no attention to the spacing of the data or indeed their time series aspect. -egranger- will not drop a "random number of observations" in either a technical or a non-technical sense. If for example your data run ..., Friday, Monday, ... then the previous value for Monday is necessarily missing (meaning here, not present in your data). Business calendars would presumably reduce this problem. Nick On Thu, Aug 16, 2012 at 7:56 PM, Alex Letko <aletko1@gmail.com> wrote: > Hi Nick, > > Thanks for your reply. That must be the issue. There are indeed gaps > in the data. But, I don't see why -tsset- in terms of the actual dates > would actually cut out any of the observations. The total number of > observations, not counting any gaps, is 3130. And for each point in > time there is an observation. (there are no blanks from 1 to 3130; > they have all already been dropped). So why would I get a random > number of observations dropped in the egranger command, considering > that routine regressions come out just fine? > > Thanks, > > Alex > > On Thu, Aug 16, 2012 at 6:35 PM, Nick Cox <njcoxstata@gmail.com> wrote: >> -tsset- in terms of observation number will ignore gaps in the dates, >> whereas -tsset- in terms of actual dates won't. I don't think you >> should point a finger at -egranger- (SSC) unless you know that this >> isn't a consequence of your data, e.g. no observations for days in >> which there was no business. >> >> As you found -if tin(...)- won't make a difference here. >> >> Nick >> >> On Thu, Aug 16, 2012 at 6:25 PM, Alex Letko <aletko1@gmail.com> wrote: >> >>> The egranger command will not run the Engle-Granger 2-step >>> cointegration test accross my entire sample. My sample consists of >>> 3130 observations. It only runs the test up to observation 2443, as >>> shown in the output below: >>> >>> ***************************************** >>> . egranger lnHH lnNBP >>> Replacing variable _egresid... >>> >>> Engle-Granger test for cointegration N (1st step) = 3130 >>> >>> N (test) = 2443 >>> ------------------------------------------------------------------------------ >>> Test 1% Critical 5% Critical 10% Critical >>> Statistic Value Value Value >>> ------------------------------------------------------------------------------ >>> Z(t) -2.424 -3.432 -2.862 -2.567 >>> >>> Critical values from MacKinnon (1990, 2010) >>> ***************************************** >>> >>> As you can see, the 1st step regression is done with the entire >>> sample, while the second step is only done with 2443 observations. >>> This only happens after I tsset my data according to the actual dates >>> of my dataset. Like this: >>> >>> gen Date=date(date1, "DMY") >>> format Date %td >>> tsset Date >>> >>> When I only tsset not according to the date, like this: >>> >>> gen time=_n >>> tsset time >>> >>> it works fine and uses all the observations in the first step and 3129 >>> in the second step. >>> >>> I try to outsmart Stata by using the "tin" command, like so: >>> >>> egranger lnHH lnNBP if tin(07sep1999, 03jul2012) >>> >>> but I get the same exact results as the output above. >>> >>> Is there a way of getting egranger to use the entire sample in the second step? * * 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/

**Follow-Ups**:**Re: st: Getting the 'egranger' command to use the entire sample***From:*Alex Letko <aletko1@gmail.com>

**References**:**st: Getting the 'egranger' command to use the entire sample***From:*Alex Letko <aletko1@gmail.com>

**Re: st: Getting the 'egranger' command to use the entire sample***From:*Nick Cox <njcoxstata@gmail.com>

**Re: st: Getting the 'egranger' command to use the entire sample***From:*Alex Letko <aletko1@gmail.com>

- Prev by Date:
**Re: st: -outreg- issue** - Next by Date:
**Re: st: Use Regular Expressions to replace words/strings of characters in a text file** - Previous by thread:
**Re: st: Getting the 'egranger' command to use the entire sample** - Next by thread:
**Re: st: Getting the 'egranger' command to use the entire sample** - Index(es):