BookmarkSubscribeRSS Feed
KrisDeng
Obsidian | Level 7

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!

4 REPLIES 4
Reeza
Super User

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

 

KrisDeng
Obsidian | Level 7

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.

Reeza
Super User

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. 

 

 

KrisDeng
Obsidian | Level 7

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.

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1270 views
  • 1 like
  • 2 in conversation