You are on page 1of 4

export results - Printed on 24-Oct-23 9:56:05 AM

1
2 * xuất bản kết quả hồi quy của nhiều mô hình trên cửa sổ Stata
3
4 ** Cách 1
5 sysuse auto, clear
6 eststo: regress price weight mpg
7 eststo: regress price weight mpg foreign
8 esttab
9 eststo clear
10
11
12 ** Cách 2
13
14 regress price weight mpg
15 estimates store model1
16 regress price weight mpg foreign
17 estimates store model2
18 esttab model1 model2
19 estimates clear
20
21 ** Tùy chỉnh các số liệu cần xuất ra
22
23
24 eststo: regress price weight mpg
25 eststo: regress price weight mpg foreign
26 esttab, se ar2
27
28
29 esttab, p scalars(F df_m df_r)
30 eststo clear
31
32 ** trình bày giá trị chuẩn hóa của các hệ số ước lượng
33
34 eststo: regress price weight mpg
35 eststo: regress price weight mpg foreign
36 esttab, beta not
37 eststo clear
38
39 ** Xuất kết quả sao cho giá trị p-value nằm bên phải trị thống kê
40
41 eststo: regress price weight mpg
42 eststo: regress price weight mpg foreign
43 esttab, wide
44 eststo clear
45
46
47 * Xuất kết quả với tùy chọn về số chữ số thập phân
48
49 eststo: regress price weight mpg
50 eststo: regress price weight mpg foreign
51 esttab, b(a6) p(4) r2(4) nostar wide
52 eststo clear
53
54
55
56 * Xuất kết quả với tên biến, tên bảng, ghi chú,...
57
58 eststo: regress price weight mpg
59 eststo: regress price weight mpg foreign
60 esttab, label ///
61 title(This is a regression table) ///
62 nonumbers mtitles("Model A" "Model B") ///

Page 1
export results - Printed on 24-Oct-23 9:56:06 AM
63 addnote("Source: auto.dta")
64 eststo clear
65
66
67 * Với độ dài tên của biến, cách ký hiệu biến tương tác
68
69 eststo: regress price mpg i.foreign
70 eststo: regress price c.mpg##i.foreign
71 esttab, varwidth(25)
72 esttab, varwidth(25) label
73 esttab, varwidth(25) label nobaselevels interaction(" X ")
74 eststo clear
75
76
77 * Kết quả với định dạng tối thiểu trong các định dạng đang có
78
79
80 eststo: regress price weight mpg
81 eststo: regress price weight mpg foreign
82 esttab, plain
83 eststo clear
84
85
86
87 * Kết quả theo chiều ngang, phù hợp với các mô hình và không có ngắt dòng.
88
89
90 eststo: regress price weight
91 eststo: regress price weight mpg
92 eststo: regress price weight mpg foreign
93 eststo: regress price weight mpg foreign displacement
94 esttab, compress
95 eststo clear
96
97 * Kết quả với ký hiệu cho các mức ý nghĩa
98
99
100 eststo: regress price weight mpg
101 eststo: regress price weight mpg foreign
102 esttab, star(+ 0.10 * 0.05)
103 eststo clear
104
105
106 *======================================================================
107 **
108 *======================================================================
109
110 * Định dạng excel
111
112 sysuse auto, clear
113 eststo: regress price weight mpg
114 eststo: regress price weight mpg foreign
115 esttab using example.csv
116
117
118 * Định dạng Word
119
120 sysuse auto, clear
121 eststo: regress price weight mpg
122 eststo: regress price weight mpg foreign
123 esttab using example.rtf
124

Page 2
export results - Printed on 24-Oct-23 9:56:06 AM
125
126 // thêm tùy chọn nhãn biến cho bảng
127 lab var mpg "The mgp variable has a really long label and that would disturb the table"
128 esttab using example.rtf, replace label nogap onecell
129
130 // Thêm tùy chọn cho tên bảng
131
132 esttab using example.rtf, replace nogaps ///
133 title({\b Table 1.} {\i This is the 1{\super st} table})
134 eststo clear
135
136
137 * dạng Latex
138 /*
139 \documentclass{article}
140 \begin{document}
141 \input{example.tex}
142 \end{document}
143 */
144
145 eststo: regress price weight mpg
146 eststo: regress price weight mpg foreign
147 esttab using example.tex, label nostar ///
148 title(Regression table\label{tab1})
149
150 // Thêm tùy chọn tên bảng
151 esttab using example.tex, label nostar replace booktabs ///
152 title(Regression table\label{tab1})
153
154 // Thêm ký hiệu các mức ý nghĩa
155
156 esttab using example.tex, label replace booktabs ///
157 alignment(D{.}{.}{-1}) ///
158 title(Regression table\label{tab1})
159
160 // Thêm tùy chọn về độ rộng của bảng
161
162 esttab using example.tex, label replace booktabs ///
163 alignment(D{.}{.}{-1}) width(0.8\hsize) ///
164 title(Regression table\label{tab1})
165 eststo clear
166
167
168 * Thêm tùy chọn là các trị thống kê kiểm định chẩn đoán mô hình
169
170 regress price weight mpg foreign
171 estadd vif
172 esttab, aux(vif 2) wide nopar
173
174
175
176
177 regress price weight mpg foreign
178 estadd vif
179 esttab, cells("b(fmt(a3) star) vif(fmt(2))" t(par fmt(2)))
180
181
182 * Yêu cầu Stata hiển thị tất cả các tùy chọn sẵn có của bảng
183 eststo: regress price weight mpg
184 eststo: regress price weight mpg foreign
185 esttab, noisily notype
186 return list

Page 3
export results - Printed on 24-Oct-23 9:56:06 AM
187 eststo clear

Page 4

You might also like