Stata--log文档

log文档是记录程序及其运行的文档,它将所有在结果窗口出现的程序和结果输出到log文档(默认是scml格式,Stata特定的文件格式;也可以输出为txt,在log using时修改后缀名)。从log using 到 log close中间所有的程序及其运行结果都会被记录到log文件中。

global output "xxx" //define the output direction to store log files
log using $output\\mylog,replace  //open a log file (default format is smcl) to record codes and results
.
. 
.
log close //close the log file and save the log file

global output "xxx" //define the output direction to store log file
log using $output\\mylog,append  //append the codes and results to the origin log file mylog (default format is smcl)
.
.
.
log close //close the log file and save the log file

你可能感兴趣的:(Stata--log文档)