P: Probability

Description Usage Arguments Value Note Examples

View source: R/PE.R

Description

Probability

Usage

1
P(..., weights = "N", keep_df = FALSE)

Arguments

...

What to compute the probability of

weights

The name of the column containing sample weights. Set to NULL for no weighting.

keep_df

If TRUE, the resulting data frame is returned (which will contain additional columns for conditioned variables).

Value

A numeric vector containing the computed expectation.

Note

Assumes a data frame named "dat" is defined in the global environment. This will be modified in future versions.

Examples

1
2
3
4
P(Y == 1)
P(Y == 0 | A == 0)
P(Y | A)
P(Y == 1 | A == 0, C)

tgrimes/PE documentation built on Sept. 2, 2020, 2:49 p.m.