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]

st: hprescott command with by prefix for panel data


From   "Andreas Ferrara" <[email protected]>
To   [email protected]
Subject   st: hprescott command with by prefix for panel data
Date   Sat, 8 Jan 2011 09:14:09 -0000 (GMT)

Dear Statalisters,

I try to use the Hodrick-Prescott filter to smooth a time-series with 2
observations per day (morning and evening observations). In one of
Christopher Baum's presentations on filtering techniques he introduces the
hprescott comand, stating that:
"It may be applied in a panel context with the by: prefix."

So now I have an id variable for a given day, covering the morning and
evening obs thus for 3000 obs there are 1500 ids. The data is tsset using
a time variable where time = _n.

When using the hprescott command with the by prefix (and a smoothing
paramter of 1600000 for daily data), it displays the following error
message:

. sort id

. by id: hprescott var, stub(test) smooth(1600000)
             hprescott():  3301  subscript invalid
                 <istmt>:     -  function returned error

I tried different tsset variables, id vars etc but couldn't figure out
what went wrong here. For any help on this I'd be most grateful.

Thanks in advance and best wishes,

Andy Ferrara


-- 
The Sunday Times Scottish University of the Year 2009/2010
The University of Stirling is a charity registered in Scotland, 
 number SC 011159.

*
*   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