BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AlexeyS
Pyrite | Level 9

Hello, i don't know where is my error.

Suppose i have a normal distribution, and to calculate critical values :

data criticalvalue;
alpha=0.05;
normal_left = round(quantile('NORMAL', alpha), .001);
normal_right = round(quantile('NORMAL', 1-alpha), .001);
normal_two = round(quantile('NORMAL', 1-alpha/2), .001);
run;

Now, i wan to calculate p-values, based on critical values :

data p_values;
zstat = -1.645;
normal_left = probnorm(zstat);
normal_right = probnorm(abs(zstat));
normal_two = 2*(1 - probnorm(abs(zstat)));
run;

My question is : why p-value normal_two is not equal to probability for two_sided when i calculated critical value(1-alpha/2)? In p-value i got 0.1, and probability for critical value i got 0.975. So, what's wrong?

Thank you

 

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Or to show the symmetry:

 

 71         data _null_;
 72         alpha=0.05;
 73         q_left = round(quantile('NORMAL', alpha), .001);
 74         q_right = round(quantile('NORMAL', 1-alpha), .001);
 75         q_two = round(quantile('NORMAL', 1-alpha/2), .001);
 76         p_left = probnorm(q_left);
 77         p_right = 1 - probnorm(q_right);
 78         p_two =  2 * (1 - probnorm(q_two));
 79         put (_all_) (=/);
 80         run;
 
 alpha=0.05
 q_left=-1.645
 q_right=1.645
 q_two=1.96
 p_left=0.0499849055
 p_right=0.0499849055
 p_two=0.0499957903
PG

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

It's not a linear translation, you have the wrong value of zstat.

 

data p_values;
zstat = -1.645;
normal_left = probnorm(zstat);
normal_right = probnorm(abs(zstat));
normal_two = 1-probnorm(1.96);
run;
--
Paige Miller
AlexeyS
Pyrite | Level 9
Thank you
PaigeMiller
Diamond | Level 26

Or another solution

 

data p_values;
zstat = -1.645;
normal_left = probnorm(zstat);
normal_right = probnorm(abs(zstat));
normal_two = 1-probnorm(quantile('NORMAL', 1-alpha/2));
run;
--
Paige Miller
PGStats
Opal | Level 21

Or to show the symmetry:

 

 71         data _null_;
 72         alpha=0.05;
 73         q_left = round(quantile('NORMAL', alpha), .001);
 74         q_right = round(quantile('NORMAL', 1-alpha), .001);
 75         q_two = round(quantile('NORMAL', 1-alpha/2), .001);
 76         p_left = probnorm(q_left);
 77         p_right = 1 - probnorm(q_right);
 78         p_two =  2 * (1 - probnorm(q_two));
 79         put (_all_) (=/);
 80         run;
 
 alpha=0.05
 q_left=-1.645
 q_right=1.645
 q_two=1.96
 p_left=0.0499849055
 p_right=0.0499849055
 p_two=0.0499957903
PG

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

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
  • 1273 views
  • 0 likes
  • 3 in conversation