Dear all,
I need to do a regression for each firm with reg ret mktret, where ret is return of the firm and mktret is the return of the market that the firm is in. The market is described by the variable sic. The specific firm is defined by cusip. Then, for every firm I want to replace alpha with the constant of that regression, and beta with the coefficient of mktret.
Can someone help me and tell why this is wrong?
gen int sicint = sic
levelsof sicint, local(sicintlist)
foreach cus of local sicintlist{
qui reg ret mktret if cusip =="`cus'"
replace alpha = _b[_cons]
replace beta = _b[mktret]
}
Thanks in advance!
I need to do a regression for each firm with reg ret mktret, where ret is return of the firm and mktret is the return of the market that the firm is in. The market is described by the variable sic. The specific firm is defined by cusip. Then, for every firm I want to replace alpha with the constant of that regression, and beta with the coefficient of mktret.
Can someone help me and tell why this is wrong?
gen int sicint = sic
levelsof sicint, local(sicintlist)
foreach cus of local sicintlist{
qui reg ret mktret if cusip =="`cus'"
replace alpha = _b[_cons]
replace beta = _b[mktret]
}
Thanks in advance!

Comment