Description Usage Arguments Value Author(s) References See Also Examples
Creates array from YourCast output for each geographical unit.
1 | array.yourcast(x, unlog=FALSE)
|
x |
A |
unlog |
Logical. Should the dependent variable be unlogged? Default: |
Creates array(s) from yourcast
output. One array is created per geographic area. If there is one geographic area, an array is returned; else, a named list of arrays is returned. Each array is of size T (number of times) by A (number of ages) by 3, where the last dimension captures the type of data: y
(observed values), yhat
(predicted values), and comb
(observed values in-sample and predicted values out-of-sample).
Konstantin Kashin kkashin@fas.harvard.edu.
http://gking.harvard.edu/yourcast
yourcast
function and documentation
(help(yourcast)
)
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Run Lee-Carter model for Figure 2.6 in Demographic Forecasting
data(chp.2.6.1)
ff.allc <- log(allc2/popu2) ~ time
ylc.allc <- yourcast(formula=ff.allc, dataobj=chp.2.6.1, model="LC",
elim.collinear=FALSE,
sample.frame=c(1950,2000,2001,2060))
yc.array <- array.yourcast(ylc.allc)
names(yc.array)
# predicted mortality rates (observed in-sample and predicted out-of-sample)
# for geographic area '4150'
yc.array[["4150"]][,,"comb"]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.