Hello there,
I'm trying to use proc reg to estimate capm model, i've sorted the data by some conditions (permno date), but the codes didn't work, the log says Interactivity disabled with By processing, can anybody help me with that problem?
proc reg noprint data=aa03 outest=capm;
model exret=mkt_rf / sse ;
by permno date;
run;
"Interactivity disabled with By processing" is an informative Note, not an error at all.
Proc REG, like all (I think) proc's that accept the quit statement is an "interactive" module. I.e. you could enter:
proc reg data=mydata;
var y x1 x2 x3;
model y=x1 x2;
run;
Then you could examine the results, and spontaneously choose another model (using any vars in the VARS statement):
model y= x1 x3;
run;
The data wouldn't be reread, because proc reg stored the SSCP for all 4 variables, so any models among those variables could be estimated. Also, for large datasets, I suspect the first model would take much longer that later models.
You wouldn't get out of proc reg until you issue a "quit:" statement, or start a new PROC.
But a BY statement would mean that proc reg would have to create an SSCP matrix for each by group, and I suspect that the 2nd SSCP replaces the first in memory, the 3rd replaces the 2nd, etc. If that's the case, then you couldn't "interactively" enter the second model, because the only sscp available would be for the last by group.
All this means is that there's no changing the proc reg in mid-stream.
Hi, thanking for replying.
How could I fix that problem, because when i open the temp work, all my independent variables are zero, and dependent variables are -1.
songchan
I just notice your PROC REG code includes:
BY PERMNO DATE;
suggesting you are using CRSP data, which has one observation per permno/date. No regression possible.
Since you want a Capital Asset Pricing Model estate, which is usually applied to a single stock, or each to a portfolio, you probably should use:
BY PERMNO;
Hi,
I did what you suggested, but the result shows that my exret=-1, what that means?
Thank you,
Songchan
By the way, my data was sorted into ten groups, i want to run regression in every rank, so i wrote
by permno myrank,
but result shows that exret=0, and numbers of regressors in model were very small (eg. 0.105..) as well as numbers of parameters in model were.
Kind regards,
Songchan
Why don't you focus on doing the work you need with 1 permno, just to make sure you have the proper process. Then do it for 10 PERMNO's, 1 in each decile, using a BY statement.
Hi, I was replicating momentum strategy, i.e. divide all stocks into ten deciles, and calculate capm alpha for each decile. So i need ten alphas in total eventually.
Songchan
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: