P: Probability function

Description Usage Arguments Details Value See Also Examples

View source: R/P.R

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

A numeric value of 0, 0.5 or 1. 1 if x < y, 0.5 if x == y and 0 if x > y

See Also

pim and pim.formula for more information on how this is used inside a pim context.

Examples

1
# Check in pim

pim documentation built on March 26, 2020, 7:57 p.m.