Hi,
I have problem with using generate command with by option in panel data.
My code looks like this:
xtset id reportyear
gen nfi = a - b
gen dnv = nfi + c + d +e
bysort somevariable reportyear: gen nvai = (dnv - L.dnv) / L.dnv
When I execute the do file it returns error: Not sorted?
Can someone explain what is the problem? I think stata is confused because I am working in panel and want to make growth rate by non-id variable?
I have problem with using generate command with by option in panel data.
My code looks like this:
xtset id reportyear
gen nfi = a - b
gen dnv = nfi + c + d +e
bysort somevariable reportyear: gen nvai = (dnv - L.dnv) / L.dnv
When I execute the do file it returns error: Not sorted?
Can someone explain what is the problem? I think stata is confused because I am working in panel and want to make growth rate by non-id variable?
Comment