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

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Último (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

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