prob: Quantiles used by a life table.

Description Usage Arguments Details Value See Also Examples

Description

Extract or change the prob slot of an object of class LifeTable. The prob slot specifies the quantiles used in displays, in a life table that has a dimension with dimtype "iterations".

Usage

1
2
3
4
5
6
7
8
9
prob(object)

prob(object) <- value

## S4 method for signature 'LifeTable'
prob(object)

## S4 replacement method for signature 'LifeTable'
prob(object) <- value

Arguments

object

An object of class LifeTable.

value

A numeric vector.

Details

prob does not affect the underlying data, which are always stored as iterations, rather than quantiles.

If object does not have a dimension with dimtype "iterations", then prob has no effect.

The quantiles must be between 0 and 1 (inclusive) and must be ordered from smallest to largest.

Value

The extraction function returns a numeric vector, and the replacement function returns a LifeTable object with a new value for the prob slot.

See Also

Life tables are created using function LifeTable.

Examples

1
2
3
4
5
6
7
8
9
mx <- dembase::ValuesOne(c(0.2, 0.05, 0.1, 0.4),
               labels = c("0", "1-4", "5-9", "10+"),
               name = "age")
mx <- dembase::perturb(1000 * mx, n = 20) / 1000
lt <- LifeTable(mx)
lt
prob(lt)
prob(lt) <- c(0.1, 0.9)
lt

StatisticsNZ/demlife documentation built on April 27, 2021, 10:02 p.m.