-1

An article in the Los Angeles Times (Dec. 3, 1993) reports that 1 in 200 people carry the defective gene that causes inherited colon cancer. In a sample of 1000 individuals, what is the approximate distribution of the number who carry this gene? Use this distribution to calculate the approximate probability that a. Between 5 and 8 (inclusive) carry the gene. b. At least 8 carry the gene.

My attempt for the question: lamda = 5

for a) sum(dpois(5:8,5))
output [1] 0.4914131
for b) ppois(7,5,lower.tail=F)
[1] 0.1333717
lmo
  • 37,904
  • 9
  • 56
  • 69
mug
  • 9
  • 4
  • Is this a statistics homework question? This doesn't seem like a specific programming question. This is not the right place to ask such questions. – MrFlick Oct 26 '16 at 19:05

1 Answers1

0

As a check, here it is using the probability mass function directly, rather than a built-in R function:

lambda = 5
y = 5:8
sum(exp(-lambda)*lambda^y/factorial(y))
[1] 0.4914131

y = 0:7
1 - sum(exp(-lambda)*lambda^y/factorial(y))
[1] 0.1333717

Looks good!

ilanman
  • 818
  • 7
  • 20