BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RazzleBayker
Calcite | Level 5

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)
ABC0.00212
BBB0.0134
D0.00414
XYZ0.0799

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

2.77 isn't rounded, change the format if you want to see more decimal places.

ie e12. or something.

View solution in original post

13 REPLIES 13
art297
Opal | Level 21

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.

RazzleBayker
Calcite | Level 5

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.

Reeza
Super User

The format is probably just rounded, try applying a different format to the variables of interest.

RazzleBayker
Calcite | Level 5

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.

Reeza
Super User

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.

RazzleBayker
Calcite | Level 5

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.

Reeza
Super User

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;

RazzleBayker
Calcite | Level 5

Hmm, it didn't change anything.


This is the original table i get after running proc reg:

                                                           Parameter  Estimates AMD
VariableDFParameter EstimateStandard Errort ValuePr > |t|
signchange10.013830.00003093447.04<.0001
LAGQV11.40022E-073.65E-0938.39<.0001
sign10.001680.0000384743.74<.0001
QV12.767E-085.03E-095.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):

Obssymbol_MODEL__TYPE__DEPVAR__RMSE_signchangeLAGQVsignQVPchangeparameters
1AMDMODEL1PARMSPchange0.029090.013831.4E-070.001682.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;

Reeza
Super User

No you didn't. See the part about changing the parameters line.

data FINAL;

set est;

format LAGQV QV e10.;

run;

RazzleBayker
Calcite | Level 5
With the parameters corrected...  still rounded but in scientific format.
Obssymbol_MODEL__TYPE__DEPVAR__RMSE_signchangeLAGQVsignQVPchange
1AMDMODEL1PARMSPchange0.029091.38E-021.40E-071.68E-032.77E-08-1
Reeza
Super User

2.77 isn't rounded, change the format if you want to see more decimal places.

ie e12. or something.

RazzleBayker
Calcite | Level 5

Amazing. Sorry for not realizing that :smileyblush:.

Thanks so much your help Reeza and Arthur, I really appreciate it!

-Razzle

RazzleBayker
Calcite | Level 5

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 13 replies
  • 1859 views
  • 4 likes
  • 3 in conversation