Hi, I am new to Stata and this forum. I have a question which I spent lots of time on but did not figure out. I am using state 15.1 SE. I use the dataset in Stata to explain it. Below is the code.
Code:
version 15.1
cls
clear
sysuse auto2.dta
drop if rep78 ==.
local outcome_variable price weight length
foreach v of varlist `outcome_variable' {
reg `v' i.rep78, robust
reg `v' i.foreign, robust
}
I want to create a table for the output of the above code like this,
|
Price |
Weight |
length |
Fair |
|
|
|
Average |
|
|
|
Good |
|
|
|
Excellent |
|
|
|
Baseline (Poor) |
|
|
|
Foreign |
|
|
|
Baseline (Domestic) |
|
|
|
The first 5 rows of the above table are for "reg `v' i.rep78, robust" and the last two rows are for "reg `v' i.foreign, robust". The first 5-row name are the value of rep78 and the last 2-row names are the value of foreign. Baseline means the omitted variable for categorical regression. They should be at the bottom of each panel (just like the above table).
In each cell, it should include the regression coefficient and standard errors. I tried to use estout but I failed.
Could you guys please help me with this?
0 Response to Question on How to Make a Panel Table Output with Categorical Regression
Post a Comment