Solved
Contributor
Posts: 24

# Parameter estimates by group - can I output them all in one table?

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.

Accepted Solutions
Solution
‎02-20-2013 05:40 PM
Super User
Posts: 20,774

## Re: Parameter estimates by group - can I output them all in one table?

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

ie e12. or something.

All Replies
PROC Star
Posts: 7,680

## Re: Parameter estimates by group - can I output them all in one table?

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.

Contributor
Posts: 24

## Re: Parameter estimates by group - can I output them all in one table?

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.

Super User
Posts: 20,774

## Re: Parameter estimates by group - can I output them all in one table?

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

Contributor
Posts: 24

## Re: Parameter estimates by group - can I output them all in one table?

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.

Super User
Posts: 20,774

## Re: Parameter estimates by group - can I output them all in one table?

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.

Contributor
Posts: 24

## Re: Parameter estimates by group - can I output them all in one table?

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.

Super User
Posts: 20,774

## Re: Parameter estimates by group - can I output them all in one table?

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;

Contributor
Posts: 24

## Re: Parameter estimates by group - can I output them all in one table?

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;

Super User
Posts: 20,774

## Re: Parameter estimates by group - can I output them all in one table?

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

data FINAL;

set est;

format LAGQV QV e10.;

run;

Contributor
Posts: 24

## Re: Parameter estimates by group - can I output them all in one table?

With the parameters corrected...  still rounded but in scientific format.
 Obs symbol _MODEL_ _TYPE_ _DEPVAR_ _RMSE_ signchange LAGQV sign QV Pchange 1 AMD MODEL1 PARMS Pchange 0.02909 1.38E-02 1.40E-07 1.68E-03 2.77E-08 -1
Solution
‎02-20-2013 05:40 PM
Super User
Posts: 20,774

## Re: Parameter estimates by group - can I output them all in one table?

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

ie e12. or something.

Contributor
Posts: 24

## Re: Parameter estimates by group - can I output them all in one table?

Amazing. Sorry for not realizing that :smileyblush:.

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

-Razzle

Contributor
Posts: 24