BookmarkSubscribeRSS Feed
MINSUN
Calcite | Level 5
How can I get a sas code to get this probability?
Q) 7% of product A do not meet the specifications. When you randomly select 20 products and check the specifications, find the probability that the number of non-standard products is less than 3.

Please help me!
2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hello @MINSUN and welcome to the SAS Support Communities!

 

Step 1: Consider how you would compute this probability mathematically.

  • What is the name of the distribution of the number of non-standard products in that random sample?
  • What are the parameter values?
  • What is the name of the function used to compute the probability that a random variable is less than or equal to a certain value?

Step 2: Go to the SAS Programming Documentation and via "Functions" to the list General Functions Listed by Category. Under "Probability" you will easily find what you need after you've answered the questions in step 1.

 

Step 3: Add SAS code to the function call from step 2 so that the result is written to the log or output window or stored in a dataset.

 

I hope this helps, but let me know if you get stuck with any of these steps.

ballardw
Super User

Additional Hint: probability that the number of non-standard products is less than 3 might be thought of as sum of probability non-standard products are exactly 0, 1 and 2.

 

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

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 955 views
  • 2 likes
  • 3 in conversation