Hello there,

I have the following quarterly data. I intend to run a piecewise linear regression of log quarterly real GDP. I have included several time dummies as suggested by several structural break tests.

I have the following code for my data

gen date = tq(2007q1)+_n-1
format date %tq
tsset date, q
local x1 d1 d2 d1trend d2trend
local x2 d3 d3trend
local x3 d4 d4trend
local predictors Trend x1 x2 x3
local regressors
foreach p of local predictors {
local regressors `regressors' ``p''
newey lrgdp Trend `regressors', lag(2)
}
This creates 4 regression results as intended.
How do I store regression estimates and that I can output using "esttab" to LaTeX?

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(date lrgdp Trend d1 d2 d3 d4 d1trend d2trend d3trend d4trend)
188  8.294883  1 0 0 0 0  0  0  0  0
189  8.352278  2 0 0 0 0  0  0  0  0
190  8.355139  3 0 0 0 0  0  0  0  0
191  8.339088  4 0 0 0 0  0  0  0  0
192  8.374704  5 0 0 0 0  0  0  0  0
193  8.419843  6 0 0 0 0  0  0  0  0
194 8.4055395  7 0 0 0 0  0  0  0  0
195  8.353112  8 0 0 0 0  0  0  0  0
196   8.36958  9 0 0 0 0  0  0  0  0
197  8.333616 10 0 0 0 0  0  0  0  0
198  8.369782 11 0 0 0 0  0  0  0  0
199  8.427577 12 0 0 0 0  0  0  0  0
200  8.399153 13 0 0 0 0  0  0  0  0
201  8.421853 14 0 0 0 0  0  0  0  0
202  8.442644 15 0 0 0 0  0  0  0  0
203  8.447304 16 0 0 0 0  0  0  0  0
204  8.434268 17 1 0 0 0 17  0  0  0
205  8.465303 18 1 0 0 0 18  0  0  0
206  8.481777 19 1 0 0 0 19  0  0  0
207  8.512626 20 1 0 0 0 20  0  0  0
208  8.533885 21 1 0 0 0 21  0  0  0
209   8.53511 22 1 0 0 0 22  0  0  0
210  8.537227 23 1 0 0 0 23  0  0  0
211  8.537109 24 1 0 0 0 24  0  0  0
212  8.542535 25 1 0 0 0 25  0  0  0
213  8.532013 26 1 0 0 0 26  0  0  0
214  8.561614 27 1 0 0 0 27  0  0  0
215  8.576252 28 1 0 0 0 28  0  0  0
216  8.576078 29 1 1 0 0 29 29  0  0
217 8.5651045 30 1 1 0 0 30 30  0  0
218  8.565078 31 1 1 0 0 31 31  0  0
219   8.57298 32 1 1 0 0 32 32  0  0
220 8.5938225 33 1 1 0 0 33 33  0  0
221  8.608116 34 1 1 0 0 34 34  0  0
222   8.62281 35 1 1 0 0 35 35  0  0
223  8.574548 36 1 1 0 0 36 36  0  0
224  8.617738 37 1 1 0 0 37 37  0  0
225  8.642376 38 1 1 0 0 38 38  0  0
226  8.632698 39 1 1 1 0 39 39 39  0
227  8.608379 40 1 1 1 0 40 40 40  0
228  8.602923 41 1 1 1 0 41 41 41  0
229  8.585226 42 1 1 1 0 42 42 42  0
230   8.60571 43 1 1 1 0 43 43 43  0
231  8.616298 44 1 1 1 0 44 44 44  0
232   8.59477 45 1 1 1 0 45 45 45  0
233  8.570775 46 1 1 1 0 46 46 46  0
234  8.563239 47 1 1 1 0 47 47 47  0
235  8.631369 48 1 1 1 0 48 48 48  0
236   8.55731 49 1 1 1 0 49 49 49  0
237  8.597376 50 1 1 1 0 50 50 50  0
238  8.611119 51 1 1 1 0 51 51 51  0
239  8.580739 52 1 1 1 0 52 52 52  0
240  8.581768 53 1 1 1 0 53 53 53  0
241  8.361883 54 1 1 1 1 54 54 54 54
242  8.480887 55 1 1 1 1 55 55 55 55
243         . 56 1 1 1 1 56 56 56 56
end
format %tq date
label var lrgdp "Log Real GDP"
label var Trend "Trend"
label var d1 "2011Q1"
label var d2 "2014Q1"
label var d3 "2016Q3"
label var d4 "2020Q2"
label var d1trend "2011Q1*Trend"
label var d2trend "2014Q1*Trend"
label var d3trend "2016Q3*Trend"
label var d4trend "2020Q4*Trend"