-
Login or Register
- Log in with
clear cd "C:/downloads/comtrade" ** obtain list of all countries comtrade list partner , listall ** Remove world and all as not needed drop if value == "World" | value == "All" ** get number of countries for display use only levelsof id, local(CtryList) foreach ctry in `CtryList' { comtrade api, maxdata(500) type(C) freq(A) years(2017) reporterc(`ctry') partnerc(all) traderegime(all) hs(HS) cl(271111) append("`c(pwd)'/hs271111_`yr'.dta") nocheck ** more calculations here }
foreach lname of unique varname {
{opt key:words(string)}
{nickopt KEYwords(string)}
gettoken do 0 : 0, parse(" ,") local ldo = length("`do'") if "`do'" == bsubstr("display",1,max(2,`ldo')) { // draw/display gr_draw_replay `0' exit } if "`do'" == bsubstr("save",1,max(4,`ldo')) { // save gr_save `0' exit } if "`do'" == bsubstr("use",1,max(3,`ldo')) { // use gr_use `0' exit } if "`do'" == bsubstr("print",1,max(5,`ldo')) { // print gr_print `0' exit } if "`do'" == bsubstr("dir",1,max(3,`ldo')) { // dir gr_dir `0' exit } if "`do'" == bsubstr("describe",1,max(1,`ldo')) { // describe gr_describe `0' exit }
gettoken do 0 : 0, parse(" ,") subcommandsyntax 0 : DIsplay save use print dir Describe ... gr_`subcommand' `0'
contract... preserve expand... bsample contract... [do calculations using this replication's frequency weights] restore
twoway function ..., recast(area)
twoway function y=f(x), ... area base(g(x))
(function..., recast(area)...)
Leave a comment: