Q: I had a question in regards to R for calculating the Poission when it was if you wish to find something such as P(X≥10). In R I typed dpois (x, lamba, log = FALSE) and could calculate items for example where I am looking for exactly 10 patients however, going back to looking for something such as P(X≥10) how would I input the command in R? I can't seem to find the actual command...please shed some light :)
A: Because the possion distribution ranges for x = {0, infinity}, you use the complement for determining such a value. For example, you want P(X≥10) and it's complement is 1 - P(X < 10) = 1 - P(X≤9), which can be determined using the ppos(x,lamba) command. In this case, it is:
> 1 - ppois(9,lambda)
where lambda is your parameter of interest.
Comment 1: As mentioned in the question, the dpois() function gives us the information for P(X=x), where little x is the quantity of interest. If we want P(X≤x), then we use ppois(), and if we want P(X≥x) we use the complement as stated. Why? Because if we wanted, for example, P(X≥10), then we would need: P(X = 10) + P(X = 11) + ... + P(X = ∞). Thus, since all probabilities must sum to equal 1, utilizing the properties of probabilities and its complement is the easiest route to take. Note that the same applies for a binomial distribution, dbinom() and pbinom().
Comment 2: Notice that, in the cases w/ discrete distributions, when we talk about the complement of P(X≥10), 1 - P(X < 10) = 1 - P(X≤9), we have to drop down a unit? Discretes use integer values, so less than 10 is the same as less than or equal to 9. Please keep this fact in mind when doing other probabilities; that is, there is a difference when we handle the inequalities (≤ and <) and (≥ and >).
No comments:
Post a Comment