Hello,
I am fairly new to Stata (17) and am trying to export some linear combination results of multiple prior regressions in a table. For some reason, when I apply the methods of different posts on statalist it is not working properly.
I run two regressions of the following :
eststo: xtreg Drevenue c.W#c.D_2021_2022#c.f_2021 ///
c.W#c.D_2020_2022#c.f_2020 c.W#c.D_2020_2022#c.f_2021 ///
c.W#c.D_2019_2022#c.f_2019 c.W#c.D_2019_2022#c.f_2020 c.W#c.D_2019_2022#c.f_2021 ///
c.W#c.D_2018_2022#c.f_2018 c.W#c.D_2018_2022#c.f_2019 c.W#c.D_2018_2022#c.f_2020 c.W#c.D_2018_2022#c.f_2021 ///
c.W#c.D_2017_2022#c.f_2017 c.W#c.D_2017_2022#c.f_2018 c.W#c.D_2017_2022#c.f_2019 c.W#c.D_2017_2022#c.f_2020 c.W#c.D_2017_2022#c.f_2021 ///
c.W#c.D_2017_2021#c.f_2017 c.W#c.D_2017_2021#c.f_2018 c.W#c.D_2017_2021#c.f_2019 c.W#c.D_2017_2021#c.f_2020 c.W#c.D_2017_2021#c.f_2021 ///
c.W#c.D_2016_2022#c.f_2016 c.W#c.D_2016_2022#c.f_2017 c.W#c.D_2016_2022#c.f_2018 c.W#c.D_2016_2022#c.f_2019 c.W#c.D_2016_2022#c.f_2020 c.W#c.D_2016_2022#c.f_2021 ///
i.year, fe vce(cluster id)
- where W is for the first regression a simple dummy and in the second a continuous variable. The D_x_y represent the cohorts in the population, where x is the year of entry in the treatment program and y the year of exit.
After both regressions, I need to compute some linear combinations on the result, some examples are below:
1) per cohort entering in 2019 : lincom (c.W#c.D_2019_2022#c.f_2019 + c.W#c.D_2019_2022#c.f_2020 + c.W#c.D_2019_2022#c.f_2021)/ 3
2) per year (eg 2020) : lincom (c.W#c.D_2020_2022#c.f_2020 + c.W#c.D_2019_2022#c.f_2020 + c.W#c.D_2018_2022#c.f_2020 + c.W#c.D_2017_2022#c.f_2020 + c.W#c.D_2017_2021#c.f_2020 + c.W#c.D_2016_2022#c.f_2020) / 6
My first problem is that even though I seem to store the regression results, once I run a lincom, the following lincom commands cannot find the coefficients/variables (_b[...]) from the regression anymore ?
These linear combinations cannot be put in a loop because depend on each year and cohort.
The second problem I am struggling with is how can I make a table with 2 columns (for the dummy and continuous W regression), without the results of xtreg (because too long), but only containing the results of the linear commands in each column?
These postestimation results should include the coefficient, stars for significance level and the standard errors.
I would be very grateful for any help,
Ariane
I am fairly new to Stata (17) and am trying to export some linear combination results of multiple prior regressions in a table. For some reason, when I apply the methods of different posts on statalist it is not working properly.
I run two regressions of the following :
eststo: xtreg Drevenue c.W#c.D_2021_2022#c.f_2021 ///
c.W#c.D_2020_2022#c.f_2020 c.W#c.D_2020_2022#c.f_2021 ///
c.W#c.D_2019_2022#c.f_2019 c.W#c.D_2019_2022#c.f_2020 c.W#c.D_2019_2022#c.f_2021 ///
c.W#c.D_2018_2022#c.f_2018 c.W#c.D_2018_2022#c.f_2019 c.W#c.D_2018_2022#c.f_2020 c.W#c.D_2018_2022#c.f_2021 ///
c.W#c.D_2017_2022#c.f_2017 c.W#c.D_2017_2022#c.f_2018 c.W#c.D_2017_2022#c.f_2019 c.W#c.D_2017_2022#c.f_2020 c.W#c.D_2017_2022#c.f_2021 ///
c.W#c.D_2017_2021#c.f_2017 c.W#c.D_2017_2021#c.f_2018 c.W#c.D_2017_2021#c.f_2019 c.W#c.D_2017_2021#c.f_2020 c.W#c.D_2017_2021#c.f_2021 ///
c.W#c.D_2016_2022#c.f_2016 c.W#c.D_2016_2022#c.f_2017 c.W#c.D_2016_2022#c.f_2018 c.W#c.D_2016_2022#c.f_2019 c.W#c.D_2016_2022#c.f_2020 c.W#c.D_2016_2022#c.f_2021 ///
i.year, fe vce(cluster id)
- where W is for the first regression a simple dummy and in the second a continuous variable. The D_x_y represent the cohorts in the population, where x is the year of entry in the treatment program and y the year of exit.
After both regressions, I need to compute some linear combinations on the result, some examples are below:
1) per cohort entering in 2019 : lincom (c.W#c.D_2019_2022#c.f_2019 + c.W#c.D_2019_2022#c.f_2020 + c.W#c.D_2019_2022#c.f_2021)/ 3
2) per year (eg 2020) : lincom (c.W#c.D_2020_2022#c.f_2020 + c.W#c.D_2019_2022#c.f_2020 + c.W#c.D_2018_2022#c.f_2020 + c.W#c.D_2017_2022#c.f_2020 + c.W#c.D_2017_2021#c.f_2020 + c.W#c.D_2016_2022#c.f_2020) / 6
My first problem is that even though I seem to store the regression results, once I run a lincom, the following lincom commands cannot find the coefficients/variables (_b[...]) from the regression anymore ?
These linear combinations cannot be put in a loop because depend on each year and cohort.
The second problem I am struggling with is how can I make a table with 2 columns (for the dummy and continuous W regression), without the results of xtreg (because too long), but only containing the results of the linear commands in each column?
These postestimation results should include the coefficient, stars for significance level and the standard errors.
I would be very grateful for any help,
Ariane
Comment