Description Usage Arguments Details Value See Also Examples
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.
1 2 3 4 |
object |
a |
useLabelStart |
Logical. If |
'Sx' differs from other life table functions in that
it requires all age groups (except the last) to have the same width
(see hasRegularAgeTime
), and
given the same set of data, 'Sx' contains one fewer age group.
'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.
An object of class Values
.
To make the age groups in a life table 'regular', in the sense
described in hasRegularAgeTime
, use function
collapseIntervals
.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.