Stata編程小筆記2——tuples
2020-10-04 12:05 作者:deepwaterqh | 我要投稿
當(dāng)我們想在stata中遍歷某些變量名時,用tuples是最好不過了,比如:
tuples?idcode year treat post,display
會出現(xiàn):
tuple1: post
tuple2: treat
tuple3: year
tuple4: idcode
tuple5: treat post
tuple6: year post
tuple7: year treat
tuple8: idcode post
tuple9: idcode treat
tuple10: idcode year
tuple11: year treat post
tuple12: idcode treat post
tuple13: idcode year post
tuple14: idcode year treat
tuple15: idcode year treat post
可以發(fā)現(xiàn),該命令可以對你放進(jìn)去的變量自動組合,并生成新的元組,那么如何方便地查看生成多少個元組呢?
dis `ntuples'?
此后,再也不要說stata不能遍歷變量了~~
完結(jié),撒花~
標(biāo)簽: