Hi,
I wanted to create a table of my regression models with the outreg2 command. This works for 5 of my 6 models, but outreg2 does not include my last 6th model in the table and I don't understand why. Thus, the code works except for outreg2 of model 6. I've attached my code underneath and the table outreg2 produces (missing model 6). Could someone explain whether something is wrong in my code or whether there is another limit in place from e.g. Stata or outreg2? Thank you in advance!
Code:
use data_ready_5, clear
sort GVKEY Year
xtset GVKEY Year
* Model 1: only the control variables related to the dependent variable as a baseline
xtpoisson divestment_rate roa_av_2y roe_av_2y log_emp tmt_average_tenure tmt_average_age tmt_members, fe //
estat ic // computes AIC and BIC
matrix out=r(S) // creates a new matrix (table)
local AIC=out[1,5] // takes the value in first row from the fifth column and stores it in the local "AIC"
local BIC=out[1,6] // takes the value in first row from the fifth column and stores it in the local "BIC"
outreg2 using RegressionTable_def, replace word excel ///
adds (AIC, `AIC', BIC, `BIC', Log-likelihood, `e(ll)') /// goodness of fit statistics
dec(3) ///
label ctitle(Model 1) /// column title
title(Poisson Regression Results) /// table title
* Model 2: control variables and independent variable related to the dependent variable
xtpoisson divestment_rate tmt_deg_rep roa_av_2y roe_av_2y log_emp tmt_average_tenure tmt_average_age tmt_members, fe
estat ic // computes AIC and BIC
matrix out=r(S) // creates a new matrix (table)
local AIC=out[1,5] // takes the value in first row from the fifth column and stores it in the local "AIC"
local BIC=out[1,6] // takes the value in first row from the fifth column and stores it in the local "BIC"
outreg2 using RegressionTable_def, append word excel ///
adds (AIC, `AIC', BIC, `BIC', Log-likelihood, `e(ll)') /// goodness of fit statistics
dec(3) ///
label ctitle(Model 2) /// column title
* Model 3: control variables, independent variable, and TMT age diversity moderator related to the dependent variable
xtpoisson divestment_rate c.tmt_deg_rep##c.tmt_age_diversity roa_av_2y roe_av_2y log_emp tmt_average_tenure tmt_average_age tmt_members, fe
estat ic // computes AIC and BIC
matrix out=r(S) // creates a new matrix (table)
local AIC=out[1,5] // takes the value in first row from the fifth column and stores it in the local "AIC"
local BIC=out[1,6] // takes the value in first row from the fifth column and stores it in the local "BIC"
outreg2 using RegressionTable_def, append word excel ///
adds (AIC, `AIC', BIC, `BIC', Log-likelihood, `e(ll)') /// goodness of fit statistics
dec(3) ///
label ctitle(Model 3) /// column title
* Model 4: control variables, independent variable, and ROA moderator related to the dependent variable
xtpoisson divestment_rate c.tmt_deg_rep##c.roa_av_2y roe_av_2y log_emp tmt_average_tenure tmt_average_age tmt_members, fe
estat ic // computes AIC and BIC
matrix out=r(S) // creates a new matrix (table)
local AIC=out[1,5] // takes the value in first row from the fifth column and stores it in the local "AIC"
local BIC=out[1,6] // takes the value in first row from the fifth column and stores it in the local "BIC"
outreg2 using RegressionTable_def, append word excel ///
adds (AIC, `AIC', BIC, `BIC', Log-likelihood, `e(ll)') /// goodness of fit statistics
dec(3) ///
label ctitle(Model 4) /// column title
* Model 5: control variables, independent variable, and ROE moderator related to the dependent variable
xtpoisson divestment_rate c.tmt_deg_rep##c.roe_av_2y roa_av_2y log_emp tmt_average_tenure tmt_average_age tmt_members, fe
estat ic // computes AIC and BIC
matrix out=r(S) // creates a new matrix (table)
local AIC=out[1,5] // takes the value in first row from the fifth column and stores it in the local "AIC"
local BIC=out[1,6] // takes the value in first row from the fifth column and stores it in the local "BIC"
outreg2 using RegressionTable_def, append word excel ///
adds (AIC, `AIC', BIC, `BIC', Log-likelihood, `e(ll)') /// goodness of fit statistics
dec(3) ///
label ctitle(Model 5) /// column title
* Model 6: Full model
xtpoisson divestment_rate c.tmt_deg_rep##c.tmt_age_diversity c.tmt_deg_rep##c.roa_av_2y c.tmt_deg_rep##c.roe_av_2y log_emp tmt_average_tenure tmt_average_age tmt_members, fe
estat ic // computes AIC and BIC
matrix out=r(S) // creates a new matrix (table)
local AIC=out[1,5] // takes the value in first row from the fifth column and stores it in the local "AIC"
local BIC=out[1,6] // takes the value in first row from the fifth column and stores it in the local "BIC"
outreg2 using RegressionTable_def, append word excel ///
adds (AIC, `AIC', BIC, `BIC', Log-likelihood, `e(ll)') /// goodness of fit statistics
dec(3) ///
label ctitle(Model 6) /// column title
I wanted to create a table of my regression models with the outreg2 command. This works for 5 of my 6 models, but outreg2 does not include my last 6th model in the table and I don't understand why. Thus, the code works except for outreg2 of model 6. I've attached my code underneath and the table outreg2 produces (missing model 6). Could someone explain whether something is wrong in my code or whether there is another limit in place from e.g. Stata or outreg2? Thank you in advance!
Code:
use data_ready_5, clear
sort GVKEY Year
xtset GVKEY Year
* Model 1: only the control variables related to the dependent variable as a baseline
xtpoisson divestment_rate roa_av_2y roe_av_2y log_emp tmt_average_tenure tmt_average_age tmt_members, fe //
estat ic // computes AIC and BIC
matrix out=r(S) // creates a new matrix (table)
local AIC=out[1,5] // takes the value in first row from the fifth column and stores it in the local "AIC"
local BIC=out[1,6] // takes the value in first row from the fifth column and stores it in the local "BIC"
outreg2 using RegressionTable_def, replace word excel ///
adds (AIC, `AIC', BIC, `BIC', Log-likelihood, `e(ll)') /// goodness of fit statistics
dec(3) ///
label ctitle(Model 1) /// column title
title(Poisson Regression Results) /// table title
* Model 2: control variables and independent variable related to the dependent variable
xtpoisson divestment_rate tmt_deg_rep roa_av_2y roe_av_2y log_emp tmt_average_tenure tmt_average_age tmt_members, fe
estat ic // computes AIC and BIC
matrix out=r(S) // creates a new matrix (table)
local AIC=out[1,5] // takes the value in first row from the fifth column and stores it in the local "AIC"
local BIC=out[1,6] // takes the value in first row from the fifth column and stores it in the local "BIC"
outreg2 using RegressionTable_def, append word excel ///
adds (AIC, `AIC', BIC, `BIC', Log-likelihood, `e(ll)') /// goodness of fit statistics
dec(3) ///
label ctitle(Model 2) /// column title
* Model 3: control variables, independent variable, and TMT age diversity moderator related to the dependent variable
xtpoisson divestment_rate c.tmt_deg_rep##c.tmt_age_diversity roa_av_2y roe_av_2y log_emp tmt_average_tenure tmt_average_age tmt_members, fe
estat ic // computes AIC and BIC
matrix out=r(S) // creates a new matrix (table)
local AIC=out[1,5] // takes the value in first row from the fifth column and stores it in the local "AIC"
local BIC=out[1,6] // takes the value in first row from the fifth column and stores it in the local "BIC"
outreg2 using RegressionTable_def, append word excel ///
adds (AIC, `AIC', BIC, `BIC', Log-likelihood, `e(ll)') /// goodness of fit statistics
dec(3) ///
label ctitle(Model 3) /// column title
* Model 4: control variables, independent variable, and ROA moderator related to the dependent variable
xtpoisson divestment_rate c.tmt_deg_rep##c.roa_av_2y roe_av_2y log_emp tmt_average_tenure tmt_average_age tmt_members, fe
estat ic // computes AIC and BIC
matrix out=r(S) // creates a new matrix (table)
local AIC=out[1,5] // takes the value in first row from the fifth column and stores it in the local "AIC"
local BIC=out[1,6] // takes the value in first row from the fifth column and stores it in the local "BIC"
outreg2 using RegressionTable_def, append word excel ///
adds (AIC, `AIC', BIC, `BIC', Log-likelihood, `e(ll)') /// goodness of fit statistics
dec(3) ///
label ctitle(Model 4) /// column title
* Model 5: control variables, independent variable, and ROE moderator related to the dependent variable
xtpoisson divestment_rate c.tmt_deg_rep##c.roe_av_2y roa_av_2y log_emp tmt_average_tenure tmt_average_age tmt_members, fe
estat ic // computes AIC and BIC
matrix out=r(S) // creates a new matrix (table)
local AIC=out[1,5] // takes the value in first row from the fifth column and stores it in the local "AIC"
local BIC=out[1,6] // takes the value in first row from the fifth column and stores it in the local "BIC"
outreg2 using RegressionTable_def, append word excel ///
adds (AIC, `AIC', BIC, `BIC', Log-likelihood, `e(ll)') /// goodness of fit statistics
dec(3) ///
label ctitle(Model 5) /// column title
* Model 6: Full model
xtpoisson divestment_rate c.tmt_deg_rep##c.tmt_age_diversity c.tmt_deg_rep##c.roa_av_2y c.tmt_deg_rep##c.roe_av_2y log_emp tmt_average_tenure tmt_average_age tmt_members, fe
estat ic // computes AIC and BIC
matrix out=r(S) // creates a new matrix (table)
local AIC=out[1,5] // takes the value in first row from the fifth column and stores it in the local "AIC"
local BIC=out[1,6] // takes the value in first row from the fifth column and stores it in the local "BIC"
outreg2 using RegressionTable_def, append word excel ///
adds (AIC, `AIC', BIC, `BIC', Log-likelihood, `e(ll)') /// goodness of fit statistics
dec(3) ///
label ctitle(Model 6) /// column title
