其中,outreg之後接自己要輸出到的目錄及對應的文件名。replace表示替換之前doc中的內容,append表示在上壹個回歸結果的基礎上追加回歸結果。最終結果會為妳顯示變量名,顯著性等。在使用之前記得確保自己的stata裝好了outreg命令。
set more off
log using "D:\Documents\parttime\2814\CEOSAL2.log",replace
use "D:\Documents\parttime\2814\CEOSAL2.DTA", clear
reg lsalary age college grad comten ceoten sales profits mktval lsales lmktval comtensq ceotensq profmarg
outreg using"D:\Documents\parttime\2814\CEOSAL2.doc",replace
reg lsalary age grad comten ceoten sales profits mktval lsales lmktval comtensq ceotensq profmarg
outreg using"D:\Documents\parttime\2814\CEOSAL2.doc",append
reg lsalary age grad comten ceoten sales profits lsales lmktval comtensq ceotensq profmarg
outreg using"D:\Documents\parttime\2814\CEOSAL2.doc",append
log close