I have to reshape
my dataset from wide to long. I have 500 variables that range from 2016 to 2007 and are recorded as abcd2016
and so on. I needed a procedure that allowed me to reshape
without writing all the variables' names and I run:
unab vars : *2016
local stubs16 : subinstr local vars "2016" "", all
unab vars : *2015
local stubs15 : subinstr local vars "2015" "", all
and so on, then:
reshape long `stubs16' `stubs15' `stubs14' `stubs13' `stubs12' `stubs11' `stubs10' `stubs09' `stubs08' `stubs07', i(id) j(year)
but I get the error
invalid syntax
r(198);
Why? Can you help me to fix it?