Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: hprescott error: multiple panels


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: hprescott error: multiple panels
Date   Thu, 9 Feb 2006 16:17:24 -0000

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index