SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

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
 
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
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
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
 
"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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Kürzlich hochgeladen (20)

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
 
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
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
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
 
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)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
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
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

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