I'm trying to understand the user-written abar-command which defines the panel test for serial correlation introduced by Arellano & Bond 1991 (going through Stata files is sometimes easier than trying to understand the initial paper). At multiple occasions, they use the following syntax
What has me puzzled is that the expression after gen double `wtvar' is a local (`=cond("`e(cmd)'"=="newey", "=","")'), but the local is not defined anywhere and it also seems a very strange name for a local?
I'm guessing it's some sort of ad-hoc conditional statement evaluation? But even then, if the condition it's false, the line reduces to gen double `wtvar' `e(wexp)' if `touse', which makes no sense to me? Is this perhaps some old Stata syntax? The program runs under version 7.0.
I've attached the complete ado file if that helps.
Code:
tempvar wtvar e0 gen double `wtvar'`=cond("`e(cmd)'"=="newey", "=","")'`e(wexp)' if `touse' ... `=cond("`id'" == "", "", "by `id' :")' egen double `ewi' = sum(`ewvar')
I'm guessing it's some sort of ad-hoc conditional statement evaluation? But even then, if the condition it's false, the line reduces to gen double `wtvar' `e(wexp)' if `touse', which makes no sense to me? Is this perhaps some old Stata syntax? The program runs under version 7.0.
I've attached the complete ado file if that helps.
Comment