Hi,
I am working with a panel database by country(id) and monthly date in format %tm (I have dates since 1955). I am trying to do a regression with fixed effects by id and date, like this:
but Stata says that "date: factor variables may not contain negative values". I know this occurs because I have dates before 1960 but I don't know how to solve this. I tried to create a numeric variable for each month using this loop:
but the regression gives me unexpected results.
Thank you
I am working with a panel database by country(id) and monthly date in format %tm (I have dates since 1955). I am trying to do a regression with fixed effects by id and date, like this:
Code:
xtset id date reg var1 var2#var3 i.id i.date
Code:
gen date_num=0 local i=0 forval x=-60(1)38{ replace date_num=`i' if date==`x' local i=`i'+1 }
Thank you
Comment