Help using Base SAS procedures

Calculate P-values of a string of returns

Reply
Contributor
Posts: 22

Calculate P-values of a string of returns

[ Edited ]

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!

Super User
Posts: 23,659

Re: Calculate P-values of a string of returns

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

 

Contributor
Posts: 22

Re: Calculate P-values of a string of returns

[ Edited ]

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.

Super User
Posts: 23,659

Re: Calculate P-values of a string of returns

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. 

 

 

Contributor
Posts: 22

Re: Calculate P-values of a string of returns

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.

 

Ask a Question
Discussion stats
  • 4 replies
  • 114 views
  • 1 like
  • 2 in conversation