On Jan 13, 2004, at 2:33 AM, Clive wrote:
I think I encountered a more fundamental problem with -betacoef-: I
couldn't get it to work! My current regressions are weighted (which
- -betacoef- has the ability to handle according to its description),
but
when I run a model such as:
- -reg beatles john paul george ringo [pw=epstein]-
- -betacoef-
I get an r(101) error. I've tried running -betacoef- after -reg [aw]-
and
without any weights at all. All I get is silence. Adding -betacoef- as
an
option to -reg- isn't allowed.
Am I going somewhere wrong or is the package?
Yes and no. I will revise the documentation to make it clear that it
will not work with pweights, since summarize john [pw=epstein] is not a
valid command. It works with fw (which I had tested), aw, and iw.
The command itself is silent. Since you can always see the beta
coefficients by using regress, beta, it does not display them. It does
place them in r(beta). So if you do
regress
betacoef
mat list r(beta)
I wrote betacoef so that those writing programs can make use of the
beta coefficients in further computations or displays. For instance,
you might want to generate a matrix showing the beta coefficients for
various units in a panel:
webuse grunfeld,clear
drop if company>5
mat Betas = J(5,3,.)
local matr
forval i=1/5 {
qui reg invest mvalue kstock if company==`i'
betacoef
mat Betas[`i',1] = r(beta)
local matr "`matr' Comp`i'"
}
mat BetaC = Betas[1...,1..2]
mat rownames BetaC = `matr'
mat colnames BetaC = mvalue kstock
mat list BetaC
Kit
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/