Я пишу do-файл Stata и запускаю его с кодом сценария в системе Ubuntu.
Файл code. sh со следующим содержимым:
#!/bin/bash
stata < mydofile.do > run.log
mydofile .do со следующим кодом:
reghdfe y x, absorb( id year ) vce(cluster id )
eststo model1
esttab model1 using Table1.rtf, replace
twoway (scatter y x)
esttab model1 using "Table/Table1.rtf",replace ///
stats(CityFixed TimeFixed N r2 , labels("city FE" "year FE" "N" "R2" ))
Я запускаю код. sh, но не могу экспортировать график и таблицу. У меня вопрос, как решить эту проблему, чтобы получить Fig1.png и Table1.rtf?
Файл журнала
___ ____ ____ ____ ____ (R)
/__ / ____/ / ____/
___/ / /___/ / /___/ 14.1 Copyright 1985-2015 StataCorp LP
Statistics/Data Analysis StataCorp
4905 Lakeway Drive
College Station, Texas 77845 USA
800-STATA-PC http://www.stata.com
979-696-4600 stata@stata.com
979-696-4601 (fax)
Single-user Stata perpetual license:
Serial number:
Licensed to:
Notes:
1. Stata is running in batch mode.
2. Unicode is supported; see help unicode_advice.
. set more off
. use "Data/yearbook1999-2018.dta", clear
.
. reghdfe y x, absorb( id year ) vce(cluster id )
(dropped 5 singleton observations)
(MWFE estimator converged in 5 iterations)
HDFE Linear regression Number of obs = 5,258
Absorbing 2 HDFE groups F( 1, 294) = 12.50
Statistics robust to heteroskedasticity Prob > F = 0.0005
R-squared = 0.9668
Adj R-squared = 0.9647
Within R-sq. = 0.0120
Number of clusters (id) = 295 Root MSE = 0.1867
(Std. Err. adjusted for 295 clusters in id)
------------------------------------------------------------------------------
| Robust
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .0298449 .0084422 3.54 0.000 .0132302 .0464597
_cons | 18.07378 .0315133 573.53 0.000 18.01176 18.1358
------------------------------------------------------------------------------
Absorbed degrees of freedom:
-----------------------------------------------------+
Absorbed FE | Categories - Redundant = Num. Coefs |
-------------+---------------------------------------|
id | 295 295 0 *|
year | 19 0 19 |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation
. eststo model1
.
. esttab model1 using "Table/Table1.rtf",replace ///
. stats(CityFixed TimeFixed N r2 , labels("city FE" "year FE" "N" "R2" ))
command stats is unrecognized
r(199);
. twoway (scatter y x)
. graph export Figure/Fig1.png, replace
translator Graph2png not found
r(111);