Sx: Calculate Sx, the probability of surviving into the next age...

Description Usage Arguments Details Value See Also Examples

Description

Given a LifeTable, calculate the 'Sx', the probability of surviving into the next age group. 'Sx' is similar to the life table function 'Px', except that 'Sx' describes survival from one age group to the next, while 'Px' describes survival from one exact age to the next.

Usage

1
2
3
4
Sx(object, useLabelStart = TRUE)

## S4 method for signature 'LifeTable'
Sx(object, useLabelStart = TRUE)

Arguments

object

a LifeTable.

useLabelStart

Logical. If TRUE, the default, the Sx values are labelled by age at the start of the period; if FALSE, Sx values are labelled by age at the end of the period.

Details

'Sx' differs from other life table functions in that

'Sx' is mainly used in models of population dynamics, such as population projections, though it occasionally appears in life tables.

If L_x is the life table population between exact ages x and x+n, then S_x = L_{x+a} / L_x, except for the second-to-last age group, where S_x = (L_{x+a} + L_x) / L_x. (S_x is not defined for the final age group.) See below for an example.

Value

An object of class Values.

See Also

To make the age groups in a life table 'regular', in the sense described in hasRegularAgeTime, use function collapseIntervals.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
mx <- dembase::ValuesOne(c(0.2, 0.05, 0.1, 0.4),
               labels = c("0", "1-4", "5-9", "10+"),
               name = "age")
lt <- LifeTable(mx)
lt

## calling 'Sx' on a life table with irregular age intervals
## raises an error
## Not run: 
Sx(lt)

## End(Not run)

## collapse the intervals, and try again
lt <- collapseIntervals(lt, dimension = "age", width = 5)
lt
Sx(lt)

## use age at the end of the interval, rather than the start
Sx(lt, useLabelStart = FALSE)

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