Hi everyone,
I am using fvrevar in my program in combination with if `touse' but it doesn't seem to work, causing a bug in my program.
I had to use keep if `touse' to avoid this bug, any other solution is appreciated.
Here is the code for illustration:
I am using fvrevar in my program in combination with if `touse' but it doesn't seem to work, causing a bug in my program.
I had to use keep if `touse' to avoid this bug, any other solution is appreciated.
Here is the code for illustration:
Code:
sysuse auto, replace
gen t=_n
tsset t
local varlist price l.price
sum `varlist'
fvrevar `varlist' if t>=3 // "if t>=3" did not work
sum `r(varlist)'
Code:
. local varlist price l.price
.
. sum `varlist'
Variable | Obs Mean Std. dev. Min Max
-------------+---------------------------------------------------------
price |
--. | 74 6165.257 2949.496 3291 15906
L1. | 73 6085.397 2888.228 3291 15906
.
. fvrevar `varlist' if t>=3 // "if t>=3" did not work
. sum `r(varlist)'
Variable | Obs Mean Std. dev. Min Max
-------------+---------------------------------------------------------
price | 74 6165.257 2949.496 3291 15906
__000000 | 73 6085.397 2888.228 3291 15906

Comment