asdocx: Export from Stata to Word, Excel, LaTeX & HTML › Forums › asdocx Forum › How to do bys regression using ASDOCX in Stata 16 or stata 17 › Reply To: How to do bys regression using ASDOCX in Stata 16 or stata 17
I have added the bysort and by options for nested regressions. First update asdocx. One example is presented below:
asdocx_update
* Use grunfeld dataset
webuse grunfeld
* Just keep 5 companies in the dataset and then estimate regression for each company
keep if company < 6
* Note the bys company
bys company : asdocx reg invest mvalue kstock, nest replace
Table: Regression results
0 |1 2 3 4 5 6
----+----------------------------------------------------------------------------------------------------------
1 | (1) (2) (3) (4) (5)
----+----------------------------------------------------------------------------------------------------------
2 | 1 2 3 4 5
3 |mvalue 0.118*** 0.118*** 0.118*** 0.118*** 0.118***
4 | (0.009) (0.009) (0.009) (0.009) (0.009)
5 |kstock 0.256*** 0.256*** 0.256*** 0.256*** 0.256***
6 | (0.039) (0.039) (0.039) (0.039) (0.039)
7 |_cons -63.611*** -63.611*** -63.611*** -63.611*** -63.611***
8 | (22.376) (22.376) (22.376) (22.376) (22.376)
9 |Observations 100 100 100 100 100
10 |R-squared 0.761 0.761 0.761 0.761 0.761
---------------------------------------------------------------------------------------------------------------