- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi there
I used following code:
proc means data=master_1;
Var r;
by t;
OUTPUT out = final;
RUN;
I got mean std;
I'm wondering how can I get t value and P in this case. What code should I use?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Xinhui wrote:
T is a veriable ”time"
t has value 1,2,3,.....18,
R is the return,
I have 500 firms' data in the sample.
I want to get T-statistic and P vlue for returns, based on different groups of samples by t, T=1,2....18.
I say again: to have a P-value you have to conduct a statistical test. So what exact statistical test is your P-value supposed to reflect? Do you want to test that R is not 0? Is greater than 10? Less than 100? That the value of R is different at T=1 compared to T=2?
You can get a t-value p-value related to testing if the variable = 0 with this in proc means:
proc means data=sashelp.class mean std t probt; class sex; var height; run;
If you need to test that the hypothesized value of the mean is something besides 0 you'll need to go to a different procedure. Which gets back to what do you want to test?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can get a T value by requesting the T statistic. (Confusing as you have a variable named T);
A P value requires a test. What test do want to run?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
T is a veriable ”time"
t has value 1,2,3,.....18,
R is the return,
I have 500 firms' data in the sample.
I want to get T-statistic and P vlue for returns, based on different groups of samples by t, T=1,2....18.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Xinhui wrote:
T is a veriable ”time"
t has value 1,2,3,.....18,
R is the return,
I have 500 firms' data in the sample.
I want to get T-statistic and P vlue for returns, based on different groups of samples by t, T=1,2....18.
I say again: to have a P-value you have to conduct a statistical test. So what exact statistical test is your P-value supposed to reflect? Do you want to test that R is not 0? Is greater than 10? Less than 100? That the value of R is different at T=1 compared to T=2?
You can get a t-value p-value related to testing if the variable = 0 with this in proc means:
proc means data=sashelp.class mean std t probt; class sex; var height; run;
If you need to test that the hypothesized value of the mean is something besides 0 you'll need to go to a different procedure. Which gets back to what do you want to test?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
my hypothsis is
h0: r=0;
h1: r not equal to 0;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
See the different statistics and keywords and definitions here:
https://documentation.sas.com/?docsetId=proc&docsetTarget=p0v0y1on1hbxukn0zqgsp5ky8hc0.htm&docsetVer...
You want PROBT for a two tailed p-value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I got what I want
Thank you very much
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content