probability | R Documentation |
Probability
probability(x, ...)
## S3 method for class 'character'
probability(x, y, laplace = 0)
## S3 method for class 'factor'
probability(x, y, laplace = 0)
## S3 method for class 'logical'
probability(x, y, laplace = 0)
## S3 method for class 'numeric'
probability(x, FUN, ...)
x |
A scalar or vector the probability is calculated for. |
... |
Optional arguments to |
y |
A factor variable the probability distribution is calculated to get the probability of a categorical |
laplace |
A value for Laplace smoothing to avoid zero probability problem, default |
FUN |
The function to be applied to compute the probability distribution. If no function is specified, gaussian distribution density function |
x
is a scalar or vector with values from either a categorical or a continuous variable, the probability is calculated for.
Probability of x
.
Normal
Other Utils:
as_ANN_matrix()
,
degree()
,
distance()
,
list_as_numeric()
,
radian()
,
random_seed()
,
re.factor()
,
sd_pop()
,
similarity()
,
var_pop()
,
vector_as_ANN_matrix()
,
vector_as_numeric()
# Getting the probability distribution of a factor variable y
probability(levels(y), y)
# Calculate the probability of every entry within a factor variable y
probability(y, y)
# Calculate the probability of certain levels or characters of a factor variable y
probability(c("Oma", "Opa"), y)
# Compute the probability of a numeric variable underlying a gaussian probability density function
# with mean and standard deviation of x
x <- 1:10
probability(x)
# with pregiven mean and standard deviation
probability(x, mean = 0, sd = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.