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
Time lag for Multi_level fixed effect panel data.Hi all, I have some douts about time lagging for my independent variables in multi-way FE panel data…
-sreshape-i just installed -sreshape- onto stata mp.. does anyone know if it has a max variable limit? i have …
pcse for random effects model or 2 way fixed effects modelI would like to estimate a random effects model and a 2 way fixed effects model (including time as w…
coefficient of logithi every one please i have an issue when i run logistic or logit command the coefficient comes out o…
clogit vs. xtlogit, feIs there a difference between clogit and xtlogit, fe? It appears to me they both do conditional logi…
Subscribe to:
Post Comments (Atom)
0 Response to HP filter panel data
Post a Comment