Dear Statalist members,
this is my first post here and I am quite new to Stata so please don't be too harsh on me haha.
I would like to create some variables based on a conditions, I have a panel dataset with T=20 and N=19 concerning the member states of the Eurozone, I am employing a panel data threshold methodology and I have already estimated my model but due to misspecification problems I am thinking about different estimates, thus I am thinking about creating the regime-dependent coefficients manually and run for instance a regression with PCSE.
My piece of code is the following but it does not work, any good recommendations/advice would be appreciated.
#the three regimes
by Country: gen q1=0
by Country: gen q2=0
by Country: gen q3=0
# a for loop
Any
this is my first post here and I am quite new to Stata so please don't be too harsh on me haha.
I would like to create some variables based on a conditions, I have a panel dataset with T=20 and N=19 concerning the member states of the Eurozone, I am employing a panel data threshold methodology and I have already estimated my model but due to misspecification problems I am thinking about different estimates, thus I am thinking about creating the regime-dependent coefficients manually and run for instance a regression with PCSE.
My piece of code is the following but it does not work, any good recommendations/advice would be appreciated.
#the three regimes
by Country: gen q1=0
by Country: gen q2=0
by Country: gen q3=0
# a for loop
Code:
foreach x in gross_debt_L1{ replace q1=gross_debt_L1 if gross_debt_L1<=95.782 replace q2=gross_debt_L1 if gross_debt_L1<=95.782 & gross_debt_L1 <=120.038 replace q3=gross_debt_L1 if gross_debt_L1>120.038 }
Comment