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
- /
- SAS Programming
- /
- SAS Procedures
- /
- Calculate P-values of a string of returns

Topic Options

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

04-04-2018 01:43 PM - edited 04-04-2018 04:35 PM

Hello,

I'm a novice user and I have a return data set with Company, Date and Return. I would like to calculate the p-value of each company from the returns, the hypothesis is return = 0.

I have looked at a few documents about proc reg, freq, corr, mean, sql but have not found (or probably overlooked) the solution. I would really appreciate any suggestions.

Attached please find the data file I am working on.

Thank you very much in advance!

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

Posted in reply to KrisDeng

04-04-2018 01:54 PM

P-values imply a statistical test - which statistical test are you undertaking? What's your hypothesis and how are you testing it?

These aren't really SAS questions by the way, they're methodology questions that only you can really answer.

If the hypothesis is return = 0, why not just run a proc means? OR are you testing this by company?

```
proc univariate data=sashelp.class mu0=0;
var weight;
run;
```

SAS Output

Tests for Location: Mu0=0 | ||||
---|---|---|---|---|

Test | Statistic | p Value | ||

Student's t | t | 19.1449 | Pr > |t| | <.0001 |

Sign | M | 9.5 | Pr >= |M| | <.0001 |

Signed Rank | S | 95 | Pr >= |S| | <.0001 |

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

Posted in reply to Reeza

04-04-2018 02:03 PM - edited 04-04-2018 04:36 PM

Hi,

Thank you for your kind reply. To answer your question, I am actually testing a few hypotheses, including return, a regressed string of alphas from the CAPM model, and the t-value of each of these alphas. I am testing by company.

I am expecting to get a string of two-tailed p-value of each company for 3 statistics return, alpha and t-value of alpha.

Please let me know if I can provide any further information. I will try the codes your provided and see if it works.

Thank you very much.

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

Posted in reply to KrisDeng

04-04-2018 03:08 PM

I am expecting to get a string of two-tailed p-values to match each return, alpha and t-value of alpha.

Calculating things are easy, if you know the rules.

How would you calculate a p-value for each return? I have no idea of what your data looks like but I assumed you had company name, the date and return somehow calculated for that date. For a statistical test, you need more than a single data point. And what's alpha? This may be subject specific term, but my finance is pretty rusty these days.

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

Posted in reply to Reeza

04-04-2018 04:34 PM

Hi,

Thank you for your kind reply. I have reviewed and realized I need to calculate alpha for each company. My alphas and t-statistics calculated and are just other 2 statistics to evaluate return.

My apologies for my misunderstanding.

My data like you said has company, date and a calculated return. Alphas and their t-values are calculated later. I expect to estimate p-values for each of these 3 statistics.

My literal instruction was to calculate the two-sided p-values, in a format of a string data. I'd appreciate your suggestions.

Thank you very much.