R Programming Perform negative binomial distribution

0 votes

I want to know why I am getting a different answer while using density function in R:

pnbinom(3,2,.5)
#[1] 0.8125

a=dnbinom(5,0,0.5)+dnbinom(4,1,.5)+dnbinom(3,2,.5)
a
#[1] 0.15625
Mar 12, 2019 in Data Analytics by Tyrion anex
• 8,700 points
474 views

1 answer to this question.

0 votes

Try this:

pnbinom(3,2,0.5)

sum(dnbinom(0:3,2,0.5))

This will give the following output:

> pnbinom(3,2,0.5)
[1] 0.8125
> 
> sum(dnbinom(0:3,2,0.5))
[1] 0.8125
answered Mar 12, 2019 by Sophie may
• 10,610 points

Related Questions In Data Analytics

0 votes
1 answer

Negative Binomial Distribution in R Programming

You can try this: pnbinom(3,2,0.5) sum(dnbinom(0:3,2,0.5)) Here's the output: > pnbinom(3,2,0.5) [1] ...READ MORE

answered Mar 5, 2019 in Data Analytics by Tyrion anex
• 8,700 points
771 views
0 votes
1 answer

Check Distribution of Categorical Variable in R

Consider the iris dataset use the table() function ...READ MORE

answered Jul 30, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
7,957 views
0 votes
1 answer

How can I perform word stemming in R

The tm package in R provides the stemDocument() function to stem the ...READ MORE

answered Aug 20, 2018 in Data Analytics by Abhi
• 3,720 points
3,924 views
0 votes
2 answers

What are the rules to define a variable name in R programming language?

The same rules almost follow for all ...READ MORE

answered Aug 26, 2019 in Data Analytics by anonymous
• 33,030 points
14,425 views
+1 vote
1 answer

R programming error

Alright, you can either use gsub to match the ...READ MORE

answered Dec 18, 2018 in Data Analytics by Tyrion anex
• 8,700 points
440 views
0 votes
1 answer

R Programming error in 'fert'

You're using a factor: fert <- factor(c(50,20,10,10,20,50)) levels(fert) #[1] ...READ MORE

answered Dec 28, 2018 in Data Analytics by Sophie may
• 10,610 points
449 views
+1 vote
1 answer

R Programming: Market Basket Analysis Error

The basket.sorted() has less than 5 rules. Refer ...READ MORE

answered Feb 12, 2019 in Data Analytics by Sophie may
• 10,610 points
1,208 views
+1 vote
1 answer

R Programming: regexpr error

The below code will help: gregexpr("D", x) # [[1]] # ...READ MORE

answered Feb 21, 2019 in Data Analytics by Tyrion anex
• 8,700 points
370 views
+1 vote
1 answer

R Programming: matrices

Try this, It will test if a matrix ...READ MORE

answered Dec 17, 2018 in Data Analytics by Sophie may
• 10,610 points
414 views
0 votes
1 answer

R programming: Unexpected symbol error

Format your code this way: myfunction <- function() ...READ MORE

answered Dec 17, 2018 in Data Analytics by Sophie may
• 10,610 points
2,827 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP