Hello,
I am PhD student and I am new to stata. I am trying to create an hp trend for variable TourPrice in my panel dataset.
I got an error message after using the "tsfilter hp" command saying that " Number of gaps in sample: 1 (gap count includes panel changes) sample may not contain gaps".
Here are the commands that I typed:
egen countryid = group(CountryCode), label lname(countryid)
xtset countryid Time
iis countryid
tis Time
tsfilter hp TPcycleHP=TourPrice, trend(TPtrendHP)
By looking at the data browser, for the first few countries in the dataset, the HP trend was calculated (two variables TPcycleHP and TPtrendHP). The missing observations are automatically excluded and the Trend is calculated for the existing observations.
However, it suddenly stops. Starting the country Bhutan, the trend is no longer calculated, even for existing observations of the variable TourPrice. I don't understand where the problem is.
Is it because the panel is unbalanced? I dnt think that the missing observations are an issue since it already did it for the first few countries in the database.
What can I do at this point? I looked at the forums concerning this topic. Some advised to create a new time variable. (gen time =_n) and then try again. I did and it gave me the same error message.
Thank you in advance for your help.
Sincerely,
Rajwane
Related Posts with HP filter panel data
repeated time values within panelDear Statalisters! I have problems with my time variable. I tried to use this commando: xtset impo…
How to present vignettes in a tabular formatHello everyone, Could you please help me to present vignettes in a tabular format rather than a run…
The base year for finding yearly effects of the shock in DIDI wanted to estimate a difference-in-differences model using Stata looking at the effects of a trade…
discrepancy between mixed results and contrast commandHi, I'm running a mixed model for longitudinal data with a two by two categorical interaction (all o…
GEE and distributional assumptionsHello all, I am using GEE to estimate my dependent variable. The dependent variable has a lower bou…
Subscribe to:
Post Comments (Atom)
0 Response to HP filter panel data
Post a Comment