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
Option for mass replace instead of manually replacing many string variablesHello Statalisters, I want to merge two datasets using two string identifiers i.e. name of state an…
Help Interpreting Continuous Dummy Interaction Term in Fixed Effects Panel dataDear all, I have a question on how to interpret an interaction between a continuous and dummy varia…
Difference in Difference in Matching by incorporating geographical fixed effectsDear All, I would like to ask about matching. If I have a panel data and I want to run Difference i…
Propensity score matching commandHello everyone, i want to use propensity score matching for impact evaluation. I used these ado comm…
How to align variables in longitudinal dataHi again Statalist, I have a slightly complicated question so I have this all makes sense. I have …
Subscribe to:
Post Comments (Atom)
0 Response to HP filter panel data
Post a Comment