Dear,
I read a lot of the threads before posting this question, however, did not seem to get an answer to it. I have longitudinal data (European countries). The data follow individual country from 2009 to 2023. I want to run a regression of Difference in difference (DiD) with fixed effects, however, I want to have robust and clustered standard errors at the individual level. I tried using the following:
Code:
xtdidregress (Inflation GDP Fuel_import merchandise_imports) (after2022), group (highratioXafter) time (year)
where :
ID is the id of each individual (panel variable)
year is the time variable (annually)
inflation is the outcome variable
after2022 is the dummy variable ( treatment intervention) indicate : 1= if period after 2022. 0= if period before 2022
highratio is a group of countries which indicate 1 = if the countries treated 0 = not treated
However, when I run the regression, it provides the error "ID not nested within highratioXafter".
I’m not sure where the problem is in the data or in my model.
Do you have any idea how I can nest the ID into the group variable.
Many thanks in advance!
I read a lot of the threads before posting this question, however, did not seem to get an answer to it. I have longitudinal data (European countries). The data follow individual country from 2009 to 2023. I want to run a regression of Difference in difference (DiD) with fixed effects, however, I want to have robust and clustered standard errors at the individual level. I tried using the following:
Code:
xtdidregress (Inflation GDP Fuel_import merchandise_imports) (after2022), group (highratioXafter) time (year)
where :
ID is the id of each individual (panel variable)
year is the time variable (annually)
inflation is the outcome variable
after2022 is the dummy variable ( treatment intervention) indicate : 1= if period after 2022. 0= if period before 2022
highratio is a group of countries which indicate 1 = if the countries treated 0 = not treated
However, when I run the regression, it provides the error "ID not nested within highratioXafter".
I’m not sure where the problem is in the data or in my model.
Do you have any idea how I can nest the ID into the group variable.
Many thanks in advance!