Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Re: output p value and t statistics

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 06-08-2012 07:11 PM
(5447 views)

I have a panel data with issuecd (stock id) and date (time). I'm doing regression by issuecd, computing Newey West standard error. 'Outest' can output the coefficients. How can I output the p value and t statistic? Below is my code:

**proc****model** data=kse9;

by issuecd;

parms b0 b1 b2 b3;

log_vol=b0+b1*D+b2*log_AVE_vol+b3*log_AVE_mvol;

fit log_vol/gmm kernel=(BART,

instruments D log_AVE_vol log_AVE_mvol;

Also, How can I suppress the output. Since I have >1000 stocks, a message pops up like: window is full. Then I have to choose to File, Save, clear window without saving.... I don't know how to deal with it.

BTW, how to use outparms?

Thanks

7 REPLIES 7

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Check out this paper on using the ODS facility

You can also close the odd output once you set it up to go to tables, using odd listing close so your output window doesn't get full.

http://www.lexjansen.com/pharmasug/2012/TF/PharmaSUG-2012-TF22-SAS.pdf

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

thanks for your suggestion. I use ods all the times.

Anyway, 'outest' only outputs coefficients, how can I output p value and t statistic? by outest, I have

column 1 column 2 column 3

issuecd date coefficients.

I need a column 4 - p value and column 5- t statistics.

thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If they're in the output you get from SAS and there isn't a default option mentioned in the docs (didn't check and I'm not familiar with proc model) then you'll need to capture the ods table thats contains the p-value and t statistics which you can then merge with the outset table or capture the ODS table that gets displayed.

The paper suggested goes over how to do that.

You probably need to add in the last line as below before run.

**proc****model** data=kse9;

by issuecd;

parms b0 b1 b2 b3;

log_vol=b0+b1*D+b2*log_AVE_vol+b3*log_AVE_mvol;

fit log_vol/gmm kernel=(BART,

instruments D log_AVE_vol log_AVE_mvol;

ods output ParameterEstimates=sample1;

**run**;

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

let me clarify the code.

There are 1000 stocks (issuecd). I'm running regression for each stocks. There will be coefficients, p value and t for each regression.

That's why I need

column 1 column 2 column 3 column 4 column 5

issuecd date coefficients. P T

Then by proc mean, I can find the average of coefficients, P and t.

for unknown reason, when I try

ods output ParameterEstimates=sample1;

no output is created. But I didn't similar things before. The output is similar to the default table but in different format. you can't computer average coefficients. I need a TABLE like above.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

SAS won't give it to you by default. You'll have to merge/manipulate the tables it does give you.

Post a more detailed example of what you're looking for, with numbers specifically around the coefficients.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Actually, 'ods output ParameterEstimates' does work. I also need R square. Why doesn't the following code work?

**proc****model** data=kse9;

by issuecd;

parms b0 b1 b2 b3;

log_vol=b0+b1*D+b2*log_AVE_vol+b3*log_AVE_mvol;

fit log_vol/gmm kernel=(BART,

instruments D log_AVE_vol log_AVE_mvol;

ods output ParameterEstimates=sample1 GoodnessOfFit=sample2 RSquare=sample3;

**run**;

Sample2 and sample3 are not created.

Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

The names ParameterEstimates is a specific table name, you need to determine what the table name is for the data you're interested in. The paper above goes through how to do that using odd trace.

ods trace on;

your code

ods trace off;

Check the log and match the table name you want with the data in the output. ResidSummary contains the Rsquared value.

**proc****model** data=kse9;

by issuecd;

parms b0 b1 b2 b3;

log_vol=b0+b1*D+b2*log_AVE_vol+b3*log_AVE_mvol;

fit log_vol/gmm kernel=(BART,

instruments D log_AVE_vol log_AVE_mvol;

ods output ParameterEstimates=sample1 residsummary=rsquared ;

**run**;

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

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.