Mean and median functions for data of class demogdata
Computes mean or median of demographic rates for each age level.
## S3 method for class 'demogdata' mean(x, series = names(x$rate)[1], transform = TRUE, na.rm = TRUE, ...) ## S3 method for class 'demogdata' median(x, na.rm = FALSE, series = names(x$rate)[1], transform = TRUE, method = c("hossjercroux", "coordinate"), ...)
x |
Demogdata object such as created using |
series |
Name of demogdata series to plot.. |
transform |
Should transform of data be taken first? |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
... |
Other arguments. |
method |
Method for computing the median. Either "coordinate" for a coordinate-wise median, or "hossjercroux" for the L1-median using the Hossjer-Croux algorithm. |
A list containing x
=ages and y
=mean or median rates.
Rob J Hyndman
Hossjer, O., and Croux, C. (1995) Generalized univariate signed rank statistics for testing and estimating a multivariate location parameter. Nonparametric Statistics, 4, 293-308.
plot(fr.mort) lines(mean(fr.mort),lwd=2) lines(median(fr.mort),lwd=2,col=2)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.