P | R Documentation |
P
Compute the cumulative distribution function for multiple distributions
P(
q,
dist = "normal",
lower.tail = TRUE,
rounding = 5,
porcentage = FALSE,
gui = "plot",
main = NULL,
...
)
q |
quantile. The |
dist |
distribution to use. The default is |
lower.tail |
logical; if |
rounding |
numerical; it represents the number of decimals for calculating the probability. |
porcentage |
logical; if |
gui |
default is |
main |
defalt is |
... |
additional arguments according to the chosen distribution. |
The argument that can have length 2, when we use the functions that give us the probability regions, given by: %<X<%
, %<=X<%
, %<X<=%
, %<=X<=%
, %>X>%
, %>X=>%
, %>X=>%
and %>=X=>%
.
The additional arguments represent the parameters of the distributions, that is:
P
returns the probability and its graphical representation. The result can be given as a percentage or not.
# Loading package
library(leem)
# Example 1 - t-Student distribution
## Not run:
P(q = 2, dist = "t-student", df = 10)
P(q = 2, dist = "t-student", df = 10, gui = 'rstudio')
P(q = 2, dist = "t-student", df = 10, gui = 'tcltk')
P(-1 %<X<% 1, dist = "t-student", df = 10)
## End(Not run)
# Example 2 - Normal distribution
P(-2, dist = "normal", mean = 3, sd = 2,
main = expression(f(x) == (1 / sqrt(n * sigma^2)) *
exp(-1/2 * (x - mu)^2/sigma^2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.