SlideShare une entreprise Scribd logo
1  sur  12
Distributions in R
Codes are in Blue.
For Feedback Mail me: sharmakarishma91@gmail.com
Discrete and Continuous Distributions
• Random Variable: It is a numerical description of the
outcome of an experiment.
• What is Experiment: A process that generates well defined
outcomes.
• Discrete Random Variable: A random Variable that may
assume either a finite no of values or an infinite sequence of
values is referred to as a discrete random variable.
For Feedback Mail me: sharmakarishma91@gmail.com
For Feedback Mail me: sharmakarishma91@gmail.com
Contd..
• Example:
Contd..
• Continuous Random Variables
A Random variable that may assume any numerical value in an
interval or collection of intervals is called a continuous
random variable. Experimental outcomes based on
measurement scales such as time, weight, distance and
temperature can be described by continuous random
variables.
For Feedback Mail me: sharmakarishma91@gmail.com
Binomial probability function
Binomial probability function
F(x) is
• n = number of trials
• k = number of successes
• n – k = number of failures
• p = probability of success in
one trial
• q = 1 – p = probability of
failure in one trial
For Feedback Mail me: sharmakarishma91@gmail.com
Poisson Probability Distribution
A discrete random variable that is often useful in estimating the
number of occurrences over a specified interval of time or
space. For example: the random variable of interest might be
the no of arrivals at a car wash in one hour or the no of leaks
in 100 miles of pipeline.
For Feedback Mail me: sharmakarishma91@gmail.com
Contd..
For Feedback Mail me: sharmakarishma91@gmail.com
Geometric distribution
If the probability of success is 0.35, what is the probability that
the first success will be on the 5th trial?
dgeom (4 ,0.35)
[1] 0.06247719
dgeom gives the density (or probability mass function for
discrete variables), pgeom gives the distribution function
and rgeom generates random deviates. This is true for the
functions used for Binomial, Poisson and Normal
calculations as well.
For Feedback Mail me: sharmakarishma91@gmail.com
Binomial distribution
If the probability of success is 0.35, what is the probability of 3
successes in 5 trials?
dbinom (3 ,5 ,0.35)
[1] 0.1811469
at least 3 successes in 5 trials?
sum( dbinom (3:5 ,5 ,0.35) )
[1] 0.2351694
For Feedback Mail me: sharmakarishma91@gmail.com
Poisson distribution
The number of track accidents per week in a small city has
Poisson distribution with mean equal to 3. What is the
probability of two accidents in a week?
dpois (2 ,3)
[1] 0.2240418
at most one accident in a week?
sum( dpois (0:1 ,3) )
[1] 0.1991483
For Feedback Mail me: sharmakarishma91@gmail.com
Normal distribution
Scores on an exam are distributed normally with a mean of 65
and a standard deviation of 12. What percentage of the
students have scores
• below 50
pnorm (50 ,65 ,12)
[1] 0.1056498
• between 50 and 70?
pnorm (70 ,65 ,12) -pnorm (50 ,65 ,12)
[1] 0.5558891
What is the 90th percentile of the score distribution?
qnorm (.90 ,65 ,12)
[1] 80.37862
For Feedback Mail me: sharmakarishma91@gmail.com
THANK YOU.
Reference: http://cran.r-project.org/
For Feedback Mail me: sharmakarishma91@gmail.com

Contenu connexe

Tendances (9)

Deciles & Quartiles - Point Measures
Deciles & Quartiles - Point  MeasuresDeciles & Quartiles - Point  Measures
Deciles & Quartiles - Point Measures
 
Stats Project PowerPoint
Stats Project PowerPointStats Project PowerPoint
Stats Project PowerPoint
 
RANK CORRELATION
RANK CORRELATIONRANK CORRELATION
RANK CORRELATION
 
Median and Mode used in Teaching
Median and Mode used in TeachingMedian and Mode used in Teaching
Median and Mode used in Teaching
 
Chapter 14
Chapter 14Chapter 14
Chapter 14
 
Quartiles, Deciles and Percentiles
Quartiles, Deciles and PercentilesQuartiles, Deciles and Percentiles
Quartiles, Deciles and Percentiles
 
2 measure of central tendency
2 measure of central  tendency2 measure of central  tendency
2 measure of central tendency
 
Rank correlation
Rank correlationRank correlation
Rank correlation
 
Central tendency m,m,m 1.2
Central tendency m,m,m 1.2Central tendency m,m,m 1.2
Central tendency m,m,m 1.2
 

Similaire à Distributions in R

Binomial distribution good
Binomial distribution goodBinomial distribution good
Binomial distribution good
Zahida Pervaiz
 
NTS-Book-for-GAT-General
NTS-Book-for-GAT-GeneralNTS-Book-for-GAT-General
NTS-Book-for-GAT-General
Ammad khan
 

Similaire à Distributions in R (20)

Quantitative Methods for Lawyers - Class #10 - Binomial Distributions, Normal...
Quantitative Methods for Lawyers - Class #10 - Binomial Distributions, Normal...Quantitative Methods for Lawyers - Class #10 - Binomial Distributions, Normal...
Quantitative Methods for Lawyers - Class #10 - Binomial Distributions, Normal...
 
Chapter 5.pptx
Chapter 5.pptxChapter 5.pptx
Chapter 5.pptx
 
Probability distribution in R
Probability distribution in RProbability distribution in R
Probability distribution in R
 
Probability unit2.pptx
Probability unit2.pptxProbability unit2.pptx
Probability unit2.pptx
 
5. RV and Distributions.pptx
5. RV and Distributions.pptx5. RV and Distributions.pptx
5. RV and Distributions.pptx
 
Binomial distribution good
Binomial distribution goodBinomial distribution good
Binomial distribution good
 
ANSWERS
ANSWERSANSWERS
ANSWERS
 
Math533 finalexamreviewapr13
Math533 finalexamreviewapr13Math533 finalexamreviewapr13
Math533 finalexamreviewapr13
 
NTS-Book-for-GAT-General
NTS-Book-for-GAT-GeneralNTS-Book-for-GAT-General
NTS-Book-for-GAT-General
 
Nts and gat general book
Nts and gat general bookNts and gat general book
Nts and gat general book
 
Week8 Live Lecture for Final Exam
Week8 Live Lecture for Final ExamWeek8 Live Lecture for Final Exam
Week8 Live Lecture for Final Exam
 
Nts book for gat general
Nts book for gat generalNts book for gat general
Nts book for gat general
 
Number and operations review1
Number and operations review1Number and operations review1
Number and operations review1
 
2.statistical DEcision makig.pptx
2.statistical DEcision makig.pptx2.statistical DEcision makig.pptx
2.statistical DEcision makig.pptx
 
Statistics-Non parametric test
Statistics-Non parametric testStatistics-Non parametric test
Statistics-Non parametric test
 
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
 
Nts book-for-gat-general
Nts book-for-gat-generalNts book-for-gat-general
Nts book-for-gat-general
 
Week8finalexamlivelecture2011 mt
Week8finalexamlivelecture2011 mtWeek8finalexamlivelecture2011 mt
Week8finalexamlivelecture2011 mt
 
Week8 livelecture2010
Week8 livelecture2010Week8 livelecture2010
Week8 livelecture2010
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Distributions in R

  • 1. Distributions in R Codes are in Blue. For Feedback Mail me: sharmakarishma91@gmail.com
  • 2. Discrete and Continuous Distributions • Random Variable: It is a numerical description of the outcome of an experiment. • What is Experiment: A process that generates well defined outcomes. • Discrete Random Variable: A random Variable that may assume either a finite no of values or an infinite sequence of values is referred to as a discrete random variable. For Feedback Mail me: sharmakarishma91@gmail.com
  • 3. For Feedback Mail me: sharmakarishma91@gmail.com Contd.. • Example:
  • 4. Contd.. • Continuous Random Variables A Random variable that may assume any numerical value in an interval or collection of intervals is called a continuous random variable. Experimental outcomes based on measurement scales such as time, weight, distance and temperature can be described by continuous random variables. For Feedback Mail me: sharmakarishma91@gmail.com
  • 5. Binomial probability function Binomial probability function F(x) is • n = number of trials • k = number of successes • n – k = number of failures • p = probability of success in one trial • q = 1 – p = probability of failure in one trial For Feedback Mail me: sharmakarishma91@gmail.com
  • 6. Poisson Probability Distribution A discrete random variable that is often useful in estimating the number of occurrences over a specified interval of time or space. For example: the random variable of interest might be the no of arrivals at a car wash in one hour or the no of leaks in 100 miles of pipeline. For Feedback Mail me: sharmakarishma91@gmail.com
  • 7. Contd.. For Feedback Mail me: sharmakarishma91@gmail.com
  • 8. Geometric distribution If the probability of success is 0.35, what is the probability that the first success will be on the 5th trial? dgeom (4 ,0.35) [1] 0.06247719 dgeom gives the density (or probability mass function for discrete variables), pgeom gives the distribution function and rgeom generates random deviates. This is true for the functions used for Binomial, Poisson and Normal calculations as well. For Feedback Mail me: sharmakarishma91@gmail.com
  • 9. Binomial distribution If the probability of success is 0.35, what is the probability of 3 successes in 5 trials? dbinom (3 ,5 ,0.35) [1] 0.1811469 at least 3 successes in 5 trials? sum( dbinom (3:5 ,5 ,0.35) ) [1] 0.2351694 For Feedback Mail me: sharmakarishma91@gmail.com
  • 10. Poisson distribution The number of track accidents per week in a small city has Poisson distribution with mean equal to 3. What is the probability of two accidents in a week? dpois (2 ,3) [1] 0.2240418 at most one accident in a week? sum( dpois (0:1 ,3) ) [1] 0.1991483 For Feedback Mail me: sharmakarishma91@gmail.com
  • 11. Normal distribution Scores on an exam are distributed normally with a mean of 65 and a standard deviation of 12. What percentage of the students have scores • below 50 pnorm (50 ,65 ,12) [1] 0.1056498 • between 50 and 70? pnorm (70 ,65 ,12) -pnorm (50 ,65 ,12) [1] 0.5558891 What is the 90th percentile of the score distribution? qnorm (.90 ,65 ,12) [1] 80.37862 For Feedback Mail me: sharmakarishma91@gmail.com
  • 12. THANK YOU. Reference: http://cran.r-project.org/ For Feedback Mail me: sharmakarishma91@gmail.com