turn on suggestions

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

Showing results for

Find a Community

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

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-08-2012 07:11 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-08-2012 08:06 PM

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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-08-2012 10:36 PM

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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-09-2012 12:56 AM

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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-09-2012 02:49 AM

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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-09-2012 01:43 PM

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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-09-2012 04:09 PM

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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-09-2012 04:22 PM

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**;