BookmarkSubscribeRSS Feed
Godzilla_Hat
Obsidian | Level 7

Porblem 1 SAS.png

 

/*Question 1 Part A*/
data elevator;
infile datalines dlm=','; 
	Mean = 1000;
	Sigma = 150;
Input X Y;
p1 = CDF('Normal',x,Mean,Sigma);
p2 = CDF('Normal',y,Mean,Sigma);
Prob = CDF('Normal',X,Mean,Sigma) - CDF('Normal',Y,Mean,Sigma); /*probability of the weights*/

drop sigma mean;
datalines; /*x and y after subtracting and adding sigma from mean, 68% is one sigma, 95% is 2 sigmas, and 99.7% is 3 sigmas*/
850,1150
700,1300
550,1450
;
proc print data=elevator;
run;
/*Part B*/
data elevator2;
infile datalines dlm=','; 
	Mean = 1000;
	Sigma = 150;
Input X Y;
p1 = CDF('Normal',x,Mean,Sigma);
p2 = CDF('Normal',y,Mean,Sigma);
Pdiff = CDF('Normal',X,Mean,Sigma) - CDF('Normal',Y,Mean,Sigma); /*probability of the weights*/
drop sigma mean;
datalines; /*  symmetry of the normal distribution and the probability of having a weight greater than 1200 is the same as having a weight less than 800.*/
775,1225
780,1220
785,1215
790,1210
795,1205
800,1200
;
proc print data=elevator2;
run;
/*Part C*/

How would I write out Part C for this problem ? What would the code look like because I'm unsure if I should use a new data set or not. I also don't know how to make a normal table of cumulative probabilities. I've done most of the problem already but I'm just stuck on this last part. Any help please on how the code would look and what the functions do exactly ? Thank you !

1 REPLY 1
Reeza
Super User
You're making it too hard. You have all the components already so just need to assemble them again in a different order.
Start with what the columns of the table should be.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 631 views
  • 0 likes
  • 2 in conversation