Hi Stata Community,
I have a Panel data ( with xtset format) and I have created egen variable to estimate the mean of the CPI for each country over the period of 2021-2022 (monthly data ) as follows ;
egen avrInf = mean(CPI) if tin(2020m1,2022m12), by(code)
When I try to identify the list of countries that had CPI in 2023 above the calculated Egen ( 2021-2022) , the program display no results , as per the below ;
# This will not show any results (
list country CPI time if tin(2023m1,) & CPI > avrInf
# This will show the results for 2022 only ( and will ignore 2023)
list country CPI time if tin(2022m1,) & CPI > avrInf
Grateful for your support and any help .
B
I have a Panel data ( with xtset format) and I have created egen variable to estimate the mean of the CPI for each country over the period of 2021-2022 (monthly data ) as follows ;
egen avrInf = mean(CPI) if tin(2020m1,2022m12), by(code)
When I try to identify the list of countries that had CPI in 2023 above the calculated Egen ( 2021-2022) , the program display no results , as per the below ;
# This will not show any results (
list country CPI time if tin(2023m1,) & CPI > avrInf
# This will show the results for 2022 only ( and will ignore 2023)
list country CPI time if tin(2022m1,) & CPI > avrInf
Grateful for your support and any help .
B

Comment