【STATA】outreg2を使って基本統計量を綺麗な表(word, excel)に出力する
目的
統計ソフトSTATAのoutreg2を用いて、変数の基本統計量(データ数平均、標準偏差、最大値、最小値)を論文に載っているようなきれいな表に出力する。
環境
- STATA13.0
サンプルコード
outreg2
をインストール(すでにインストールされている場合はこの手順をスキップ)
ssc install outreg2
使うファイルを指定。(今回はサンプルデータを利用するためsysuse...
としてある点に注意。)
sysuse auto, clear
result.xls
ファイルに表を出力
※Wordファイルに出力したい場合は、拡張子を.doc
に変更すれば可能。
outreg2 using result.xls, replace sum(log)
下記画像のような結果が得られたら、windowsユーザーの人は、画像下部の青いresult.xls
をクリック。
※macユーザーはdir: seeout
をクリック(たぶん…)
結果
追記
以下のようにオプションにkeep(任意の変数名)
と付け加えることで、任意の変数のみで表を作成できる。
outreg2 using result2.xls, replace sum(log) keep(変数1 変数2 変数3)
参考文献
Author And Source
この問題について(【STATA】outreg2を使って基本統計量を綺麗な表(word, excel)に出力する), 我々は、より多くの情報をここで見つけました https://qiita.com/c6tower/items/18f3e1bd3402290789b2著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .