Dear team,
I have the variables v1-v1553, which I like to regress with one variable mktrf. My code looks like this:
foreach x of varlist v1-v1553 {
regress `x' mktrf
}
From every regression, I'd like to save the regression coefficient (mktrf) and the constant (_cons) and display the results in a clear manner.
With this code, i'm getting the results, but in this display I can't use it:
. foreach x of varlist v1-v1553 {
2. quietly: reg `x' mktrf
3. matrix list e(b)
4. }
e(b)[1,2]
mktrf _cons
y1 -.88101135 239.65107
e(b)[1,2]
mktrf _cons
y1 -30.911128 4256.2663
......
I'm also not sure, if matrix is the best way, because with my version I can only built matrices with 800 rows. Is there a table command maybe, which displays the results properly?
This didn't work as well:
. foreach x of varlist v1546-v1549 {
2. table (result) (colname), command(_r_b: regress `x' mktrf) append
3. }
------------------------------------
| v1547 Mkt-RF
------------+-----------------------
Coefficient | -.1639949 -1.050174
------------------------------------
------------------------
| v1547
------------+-----------
Coefficient | -.1639949
------------------------
------------------------
| v1547
------------+-----------
Coefficient | -.1639949
------------------------
Best
Julius
I have the variables v1-v1553, which I like to regress with one variable mktrf. My code looks like this:
foreach x of varlist v1-v1553 {
regress `x' mktrf
}
From every regression, I'd like to save the regression coefficient (mktrf) and the constant (_cons) and display the results in a clear manner.
With this code, i'm getting the results, but in this display I can't use it:
. foreach x of varlist v1-v1553 {
2. quietly: reg `x' mktrf
3. matrix list e(b)
4. }
e(b)[1,2]
mktrf _cons
y1 -.88101135 239.65107
e(b)[1,2]
mktrf _cons
y1 -30.911128 4256.2663
......
I'm also not sure, if matrix is the best way, because with my version I can only built matrices with 800 rows. Is there a table command maybe, which displays the results properly?
This didn't work as well:
. foreach x of varlist v1546-v1549 {
2. table (result) (colname), command(_r_b: regress `x' mktrf) append
3. }
------------------------------------
| v1547 Mkt-RF
------------+-----------------------
Coefficient | -.1639949 -1.050174
------------------------------------
------------------------
| v1547
------------+-----------
Coefficient | -.1639949
------------------------
------------------------
| v1547
------------+-----------
Coefficient | -.1639949
------------------------
Best
Julius
Comment