dbinom(6,10,.697)[1] 0.2029488
Recall that we need to know how many trials, N, how many successes, n, and the probability of success p. The general formula is dbinom(n,N,p) for the probability of exactly n successes in N trials.
dbinom(6,10,.697)[1] 0.2029488
We need to know the mean, mu, and the number of instances, k. For the exact probability, the general formulation is dpois(k,mu). For lower tail probability (up to and including k) use ppois(k,mu)
dpois(2,1)[1] 0.1839397
ppois(2,1)[1] 0.9196986
To calculate probabilities associated with a Z score - that is, to get p-value - use the function pnorm. Note that setting the mean = 0 and the sd = 1 is what turns it into a standard normal curve. Setting lower.tail = TRUE gives you the lower-tail probability, which is what you are used to seeing in your Z table. The general formulation is pnorm(zscore, mean = 0, sd = 1, lower.tail = TRUE). Remember, when doing a two-tailed test you will need to multiply the p-value by 2.
pnorm(-1.96, mean = 0, sd = 1, lower.tail = TRUE)[1] 0.0249979
pnorm(1.96, mean = 0, sd = 1, lower.tail = TRUE)[1] 0.9750021
pnorm(-1.28, mean = 0, sd = 1, lower.tail = TRUE)[1] 0.1002726
pnorm(1.56, mean=0, sd=1, lower.tail = TRUE)[1] 0.9406201
To calculate p-values for a given T score, you will need the score and the degrees of freedom. Since you are used to seeing either a lower- or upper- tail in your table, you can replicate that by putting lower.tail = TRUE or FALSE as you like. The general formulation is pt(tscore, df, lower.tail = TRUE). Remember, when doing a two-tailed test you will need to multiply the p-value by 2.
pt(-2.02, 5, lower.tail=TRUE)[1] 0.04968514
pt(2.02, 5, lower.tail=FALSE)[1] 0.04968514
pt(-2.485, 25, lower.tail=TRUE)[1] 0.0100024
pt(0.5, 17, lower.tail=FALSE)[1] 0.3117426