Dear all,
Today I am experiencing an error which is quite strange (STATA 18 SE). I have the following code:
where ${xlist2}) is a global containing a set of variables names - this works well in other codes.
This code yields the following error:
string variables not allowed in varlist;
is a string variable
Note that the space on the second line before "is a string variable" is not a typo, but it is in the error I get. This is strange as it seems that a variable name is not read properly.
I was initially thinking that the error was driven by the interacted categorial variable (strange because this is a float variable which has been previously encoded). However, I have realised that it is driven by the "0" in the lag operator when it is combined with my interacted variable. Specifically, the code works when:
Yields the same error.
Thanks in advance for your help
Today I am experiencing an error which is quite strange (STATA 18 SE). I have the following code:
Code:
reghdfe d.Y (L(0/2)(${xlist2})) /// (L(0/2)(${xlist2}))#i.orig_ht_exp_cat, /// absorb(orig_isic_aux orig_iso_aux#year) vce(cluster orig_iso_aux)
This code yields the following error:
string variables not allowed in varlist;
is a string variable
Note that the space on the second line before "is a string variable" is not a typo, but it is in the error I get. This is strange as it seems that a variable name is not read properly.
I was initially thinking that the error was driven by the interacted categorial variable (strange because this is a float variable which has been previously encoded). However, I have realised that it is driven by the "0" in the lag operator when it is combined with my interacted variable. Specifically, the code works when:
- I remove the interacted categorical variable, OR
- I substitute 0 with 1 in the lag operator
Code:
reghdfe d.Y ${xlist2} /// ${xlist2}#i.orig_ht_exp_cat /// (L(1/2)(${xlist2})) /// (L(1/2)(${xlist2}))#i.orig_ht_exp_cat, /// absorb(orig_isic_aux orig_iso_aux#year) vce(cluster orig_iso_aux)
Thanks in advance for your help
Comment