Source:Archive of user-written Stata packages 导言 这里汇集了截至 2015年1月1日 为止的所有 Stata 外部命令。可以在线查看每个外部命令的帮助文件。 对于感兴趣的命令,可以使用findit在 Stata 命令窗口中搜索后下载,亦可直接使用ssc install命令直接下载。 浏览最近一个月发布的新命令,请点击- Stata最近一月外部命...
. foreach p in R S-Plus SAS SPSS Stata others { /* loop over responses */ . local P : subinstr local p "-" "" . gen byte q1_`P' = 0 . forval i = 1/6 { /* loop over existing variables */ . qui replace q1_`P' = q1_`P' + (strpos(q1_`i',"`p'") > 0) . ...
We could have instead coded forvalues i = 1(1)'k' { code in terms of ''i'' and 'k' } Similarly, at the beginning of this subsection, we said that you could use the following code in terms of while to loop over the arguments received: program . . . local i = 1 while "''i...
S458811 DICT: Stata module to loop over multiple arguments byDaniel Alves Fernandes S458810 MULTIDENSITY: Stata module for kernel density estimation for many variables or groups byNicholas J. Cox S458809 GCROBUSTVAR: Stata module to compute a VAR-based Granger-causality Test in the Presence of ...
S458811 DICT: Stata module to loop over multiple arguments by Daniel Alves Fernandes S458810 MULTIDENSITY: Stata module for kernel density estimation for many variables or groups by Nicholas J. Cox S458809 GCROBUSTVAR: Stata module to compute a VAR-based Granger-causality Test in the Presence ...
Loop over a variable list (varlist): data new(drop= i); set new; array raymond {4} var1 var2 var3 var4; do i = 1 to 4; if raymond{i} = 99 then raymond{i} = . ; end; run; Check out this array example in the SAS programming examples page. foreach i of varlist var1 ...
foreach Loop over items forvalues Loop over consecutive values frame post Post results to dataset in another frame fvexpand Expand factor varlists gettoken Low-level parsing H2O intro Introduction to integration with H2O if if programming command include Include commands from file Java intro Introducti...
find module to find matching strings across files in the current directory tssc install find finddup module to find non-unique values or observations tssc install finddup findname module to list variables matching name patterns or other properties tssc install findname findsysmis module to ...
Loop over a variable list (varlist): data new(drop= i); set new; array raymond {4} var1 var2 var3 var4; do i = 1 to 4; if raymond{i} = 99 then raymond{i} = . ; end; run; Check out this array example in the SAS ...
Python Version - Loop Through Levels Of A Categorical import pandas as pd df = pd.read_stata('http://www.stata-press.com/data/r15/auto2.dta') # Use the repair record categorical as an example for lev in df['rep78'].unique(): # Preform any function specifc to each lev (summary ...