Hello everyone,
I'm running a multiple regression by group; basically, I have a long list of stock trade data for various companies organized by ticker symbol and a regression is being run by symbol. The result is a set of parameter estimates for each company. When it's time to copy these parameter estimates into excel, it takes me ages because each set of parameter estimates is in a table on its own and i have to manually copy + paste the contents one by one. Is there anyway to have all parameter estimates appear in one table by ticker symbol? Something like this:
Ticker Symbol | (Parameter estimate A) | (Parameter estimate B) |
---|---|---|
ABC | 0.002 | 12 |
BBB | 0.013 | 4 |
D | 0.004 | 14 |
XYZ | 0.079 | 9 |
Since a lot of the parameter estimates have several zeros after the decimal (for example: 0.0000002331), I need to make sure the table provides enough decimal places for the estimates (in other words, I don't want it to be reported as "0.00").
Any help is greatly appreciated. As a SAS beginner, I must say I have learnt a great deal from these boards. Thanks in advance.
2.77 isn't rounded, change the format if you want to see more decimal places.
ie e12. or something.
Would you get what you need by using the outtest option (see: SAS/STAT(R) 9.2 User's Guide, Second Edition )? Otherwise, you should be able to get them from the ODS tables.
Thanks Arthur. I was able to get the table I needed; however, the table still rounds values. For example 2.767E-08 is coming up as 0.000000028. I don't know how to keep them in their original scientific format.
The format is probably just rounded, try applying a different format to the variables of interest.
In the original output, where the parameter estimates are reported by symbol in individual tables, there is no rounding. When I create that new table they get rounded. I wonder if there is a way I can specify no rounding in the outest function.
I don't think you're talking about 'rounding', I think you're talking about the format applied to the data.
I don't know of a way to change the format in the output step. I'd change it in a second step or where I was going to use or manipulate the format.
I think it is being rounded because when I run the proc reg step without the outest option the parameter estimate for the first symbol comes up as 2.767E-08 in the output. When I throw in the outest, the new table that contains all the symbols and their parameters is showing 0.000000028 for that same parameter estimate.
What happens when you do the following. Replace the have with the dataset you created from outest and the parameters with the names of your variables that you think are 'rounded'.
data want;
set have;
format parameters e10.;
run;
Hmm, it didn't change anything.
This is the original table i get after running proc reg:
Parameter Estimates AMD | |||||
Variable | DF | Parameter Estimate | Standard Error | t Value | Pr > |t| |
signchange | 1 | 0.01383 | 0.00003093 | 447.04 | <.0001 |
LAGQV | 1 | 1.40022E-07 | 3.65E-09 | 38.39 | <.0001 |
sign | 1 | 0.00168 | 0.00003847 | 43.74 | <.0001 |
QV | 1 | 2.767E-08 | 5.03E-09 | 5.5 | <.0001 |
This is the first row of the table i get from the OUTEST (ive underlined the parameter estimates that correspond to the table above):
Obs | symbol | _MODEL_ | _TYPE_ | _DEPVAR_ | _RMSE_ | signchange | LAGQV | sign | QV | Pchange | parameters |
1 | AMD | MODEL1 | PARMS | Pchange | 0.02909 | 0.01383 | 1.4E-07 | 0.00168 | 2.8E-08 | -1 | . |
As you can see, it's still rounding. Did I apply your code properly? The codes that I used are:
PROC REG data=GH2 outest=est;
by symbol;
model Pchange = signchange LAGQV sign QV / noint;
data FINAL;
set est;
format parameters e10.;
run;
proc print data = FINAL;
run;
quit;
No you didn't. See the part about changing the parameters line.
data FINAL;
set est;
format LAGQV QV e10.;
run;
Obs | symbol | _MODEL_ | _TYPE_ | _DEPVAR_ | _RMSE_ | signchange | LAGQV | sign | QV | Pchange | With the parameters corrected... still rounded but in scientific format.
1 | AMD | MODEL1 | PARMS | Pchange | 0.02909 | 1.38E-02 | 1.40E-07 | 1.68E-03 | 2.77E-08 | -1 |
2.77 isn't rounded, change the format if you want to see more decimal places.
ie e12. or something.
Amazing. Sorry for not realizing that :smileyblush:.
Thanks so much your help Reeza and Arthur, I really appreciate it!
-Razzle
Woops I left out the parameters that time, but I just ran it again with the parameters and it does brings up the exact same rounded values, but instead of bringing them in number format it brings them up (still rounded) in scientific format.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.