*! version 1.0.0 20nov1996 STB-34 sts12 program define _crcchkt version 5.0 local if "opt" local in "opt" local options "t(string)" parse "`*'" xt_tis `t' local realt "$S_1" tempvar tt gen `tt' = `realt'-`realt'[_n-1] `if' `in' summ `tt' `if' `in' capture assert _result(5)==_result(6) `if' `in' if _rc { noi di in red "time variable does not have constant step size" exit 198 } if _result(5) == 0 { noi di in red "tied values in time variable not allowed" exit 198 } end exit Here is how we will use this: program define version 5.0 local varlist "req ..." local if "opt" local in "opt" local options "t(string) ..." parse "`*'" _crcchkt `if' `in', t(`t') ... end