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?
@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?
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?
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.
@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?
my hypothsis is
h0: r=0;
h1: r not equal to 0;
I got what I want
Thank you very much
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: