Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -hpfilter- question

From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: -hpfilter- question
Date   Fri, 13 Feb 2004 12:01:40 -0000

Giorgio Ricchiuti 

> I have to apply the Hoddrick-Prescott Filter Command to my Panel. 
> Unfortunately this command does not permit to use "by". Please, 
> Do you know how I can deal with this problem? I have 143 countries. 
> So create 143 variables and then merge them takes quiet long time. 

Something like this may help. 

tsset country year 

gen hppredict = . 

levels country, local(C) 
qui foreach c of local C { 
	hpfilter myvar if country == `c' 
	replace hppredict = H_myvar if country == `c' 
	drop H_myvar 
See also		

[email protected] 

*   For searches and help try:

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