BookmarkSubscribeRSS Feed
6 REPLIES 6
Godzilla_Hat
Obsidian | Level 7
data elevator;
	Mean = 1000;
	Sigma = 150;
	Input X;

p = CDF('Normal',x,Mean,Sigma);


Pdiff = CDF('Normal',850,Mean,Sigma) -CDF('Normal',1150,Mean,Sigma);
drop sigma mean;

This is what I wrote so far. How would I implement the code that uses the empirical rule of 68%,95%, and 99.7%. I understand that I must add and subtract the standard deviation from the mean but how would that look like in code ?

Reeza
Super User
You almost have the 68% one - check your output and rethink the direction of your subtraction.

You can do basic math but it says you need to use cards/datalines so you can do the math in your head and just pass them to SAS, no need to make it harder than that.
Godzilla_Hat
Obsidian | Level 7

Thank you ! I think I got it. How does this look ?

data elevator;
infile datalines dlm=','; 
	Mean = 1000;
	Sigma = 150;
Input X Y;

Pdiff = CDF('Normal',X,Mean,Sigma) - CDF('Normal',Y,Mean,Sigma);

drop sigma mean;
datalines;
850,1150
700,1300
550,1450
;
proc print data=elevator;
run;

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 25. 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
  • 6 replies
  • 800 views
  • 4 likes
  • 3 in conversation