Hi all,
I'm wiriting some stata code and in one feedback from my prof, he add this ( ) parenthesis after gen,ì. I know if I want to gen dummy variable with some condition, say 1 if a==b, I can use
, but in my code, I'm just doing subtraction. Can anyone tell me the difference(with/without())?
My code is as follow:
I'm refering to the second pair of parenthesis after gen
Thanks!!
I'm wiriting some stata code and in one feedback from my prof, he add this ( ) parenthesis after gen,ì. I know if I want to gen dummy variable with some condition, say 1 if a==b, I can use
Code:
gen x = (a==b)
My code is as follow:
Code:
foreach var of varlist share_* { bysort sector_id(year): gen c`var' = (`var'[_N] - `var'[1]) }
Thanks!!
Comment