SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

La actualidad más candente (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
 

Similar a Distributions in R

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...Daniel Katz
 
Probability distribution in R
Probability distribution in RProbability distribution in R
Probability distribution in RAlichy Sowmya
 
Binomial distribution good
Binomial distribution goodBinomial distribution good
Binomial distribution goodZahida Pervaiz
 
Math533 finalexamreviewapr13
Math533 finalexamreviewapr13Math533 finalexamreviewapr13
Math533 finalexamreviewapr13Brent Heard
 
NTS-Book-for-GAT-General
NTS-Book-for-GAT-GeneralNTS-Book-for-GAT-General
NTS-Book-for-GAT-GeneralAmmad khan
 
Nts and gat general book
Nts and gat general bookNts and gat general book
Nts and gat general bookYasar Hayat
 
Week8 Live Lecture for Final Exam
Week8 Live Lecture for Final ExamWeek8 Live Lecture for Final Exam
Week8 Live Lecture for Final ExamBrent Heard
 
2.statistical DEcision makig.pptx
2.statistical DEcision makig.pptx2.statistical DEcision makig.pptx
2.statistical DEcision makig.pptxImpanaR2
 
Statistics-Non parametric test
Statistics-Non parametric testStatistics-Non parametric test
Statistics-Non parametric testRabin BK
 
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjMdSazolAhmmed
 
Nts book-for-gat-general
Nts book-for-gat-generalNts book-for-gat-general
Nts book-for-gat-generaldiaryinc
 
Week8finalexamlivelecture2011 mt
Week8finalexamlivelecture2011 mtWeek8finalexamlivelecture2011 mt
Week8finalexamlivelecture2011 mtBrent Heard
 
Week8 livelecture2010
Week8 livelecture2010Week8 livelecture2010
Week8 livelecture2010Brent Heard
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithmJari Abbas
 

Similar a 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
 

Último

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Último (20)

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

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