Dear all,
I'm trying to run some .do file, and receive an error on a line:
Error:
As far I googled, a dollar sign might mean global variable or, in some cases, just a dollar sign to be inside a variable? Could you please explain what this line might do and how can I avoid the error?
After defining it, there is a loop:
Thank you in advance.
I'm trying to run some .do file, and receive an error on a line:
Code:
local carry=$carry_months
invalid syntax
r(198);
r(198);
As far I googled, a dollar sign might mean global variable or, in some cases, just a dollar sign to be inside a variable? Could you please explain what this line might do and how can I avoid the error?
After defining it, there is a loop:
Code:
local names="AS" foreach k in `names' { forval i=1/`carry' { sort stock month_id qui gen `k'_pr_`i'=`k'[_n-`i'] if stock==stock[_n-`i'] & month_id==month_id[_n-`i']+`i' } } foreach k in `names' { forval i=1/`carry' { sort stock month_id qui replace `k'=`k'_pr_`i' if `k'==. & stock==stock[_n-`i'] & month_id==month_id[_n-`i']+`i' qui drop `k'_pr_`i' } }
Comment