I am using Stata 17 to run panel fixed effects regression.I want to use the command --collect-- to create a table.but how can I add the fixed effects into the table, such as "Country fixed effects YES" or "Year fixed effects YES".In Stata 16,we can easily use --outreg2-- to add them.But In the Collections Systerm, How can I add them?I will give an example below.
Code:
webuse grunfeld,clear
collect clear
collect _r_b _r_se, tag(model[(1)]):xtreg invest mvalue kstock i.year,fe r
collect layout (colname#result) (model)
collect style showbase off
collect style cell, nformat(%5.2f) border(right, pattern(nil))
collect style cell result[_r_se], sformat("(%s)")
collect preview
collect style cell cell_type[item column-header], halign(center)
collect style header result, level(hide)
collect style column, extraspace(1)
collect style row stack
collect preview
collect stars _r_p 0.01 "***" 0.05 "** " 0.1 "* " 1 " ", attach(_r_b)
collect layout (colname#result[_r_b _r_se] result[r2 N]) (model)
collect style header result[r2 N], level(label)
collect label levels result r2 "R-squared", modify
collect style cell result[N], nformat(%5.0f)
collect preview
-------------------------------------
(1)
-------------------------------------
Market value (prior year) 0.12***
(0.01)
Capital stock (prior year) 0.36***
(0.05)
Year=1936 -19.20
(20.70)
Year=1937 -40.69
(33.28)
Year=1938 -39.23**
(15.74)
Year=1939 -69.47**
(27.00)
Year=1940 -44.24**
(17.37)
Year=1941 -18.80
(17.85)
Year=1942 -21.14
(14.16)
Year=1943 -42.98***
(12.54)
Year=1944 -43.10***
(11.00)
Year=1945 -55.68***
(15.20)
Year=1946 -31.17
(20.92)
Year=1947 -39.39
(26.44)
Year=1948 -43.72
(38.88)
Year=1949 -73.50*
(38.25)
Year=1950 -75.90*
(36.80)
Year=1951 -62.48
(49.42)
Year=1952 -64.63
(51.56)
Year=1953 -67.72
(43.74)
Year=1954 -93.53**
(31.73)
Intercept -32.84
(19.78)
R-squared 0.80
Number of observations 200
-------------------------------------
collect export myreg.docx,replace
0 Response to how to use Stata 17 to output a table of panel fixed effects regression?
Post a Comment