Probability function

Description

This functions transform a comparison or otherwise logical value to a numeric value for use in a pim.

Usage

1
2
3
P(x)

PO(x, y = NULL)

Arguments

x

for P, a logical value. For PO a numeric value.

y

a numeric value or NULL. If NULL, the function will try to calculate PO(L(x),R(x)), provided the functions L and R are defined correctly. This is the case when PO is used in the context of a probabilistic index model fitted with pim.

Details

These functions are constructed purely for notation. P is completely equivalent to as.numeric, apart from an extra control to check whether it actually makes sense to do so. The function PO is just short for P(x < y) + 0.5*P(x == y)

Value

either 0 or 1

Examples

1
# Check in pim

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.