Great, Nick! Thank you for your prompt and helpful response!
now, the icing on the cake would be if anybody knew whether/how one can
change the range of observations used to calculate the hprescott value.
By default, hprescott uses t-2, t-1, t, t+1, t+2. Could this "window" be
enlarged to go back as far as t-5?
Thank you very much and apologies for my preposterous use of the word
"must".
nicolas winkler
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nick Cox
Sent: Thursday, February 09, 2006 5:17 PM
To: [email protected]
Subject: st: RE: RE: hprescott error: multiple panels
I was wrong. -hprescott- still looks at what
was -tsset-, so can't be fooled this way.
As the help implies, you need something more
like this:
levelsof id, local(ID)
foreach I of local ID {
hprescott myvar if id == `I', stub(foo)
}
egen foo = rowmax(foo*_*)
Nick
[email protected]
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of Nick Cox
> Sent: 09 February 2006 15:22
> To: [email protected]
> Subject: st: RE: hprescott error: multiple panels
>
>
> When you say "must" I think you mean "should".
>
> -hprescott- is written for single panels. That
> is indicated in the help.
>
> However, I think it can be applied to many panels
> with a fairly simple trick.
>
> separate myvar, by(id)
> hprescott `r(varlist)', stub(mystub)
> egen mystub = rowmax(mystub_*)
>
> Nick
> [email protected]
>
> Nicolas Winkler
>
> > I'm trying to detrend a variable using the hprescott command,
> > but after
> > typing "hprescott myvar", I receive the error code: "r(459):
> > sample may
> > not include multiple panels" !?
> > I don't have a problem with missings or duplicates and the data is
> > correctly set as time-series. Now, I've run out of ideas on what the
> > problem might be. hprescott does indeed work fine with
> singular panels
> > (hprescott myvar if id==1), but there must be a way of using
> > the command
> > on a range of panels.
> > Can anybody point me towards a solution?
*
* 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/
*
* 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/