pop * mx中的错误:不可兼容的数组?

时间:2015-06-15 20:41:26

标签: r

我试图在R中使用Lee-Carter函数调用死亡率,但我一直得到这个" pop * mx中的错误:不一致的数组"我尝试拨打电话时发出消息。

我已经存储了demogdata(我知道我没有为demogdata()的年龄参数提供一系列年龄,但我只想找到人口子集的整体死亡率I&# 39;我看着。

> (xyz = demogdata(Rates, Pop, ages = mean(data$AGE), years = 2006:2014, 
   type = "mortality", label = "US", name = "total"))
Mortality data for US
Series: total
Years: 2006 - 2014
Ages:  28.9763585116791 - 28.9763585116791

我拥有的所有变量如下:

> Rates
            [,1]        [,2]        [,3]        [,4]        [,5]
[1,] 0.002540197 0.002242095 0.001958826 0.001708285 0.001434417
            [,6]         [,7]         [,8]         [,9]
[1,] 0.001218796 0.0009218339 0.0006424075 0.0003361666


> years
[1] 2006 2007 2008 2009 2010 2011 2012 2013 2014

> Pop
       [,1]   [,2]   [,3]   [,4]   [,5]    [,6]    [,7]    [,8]    [,9]
[1,] 179120 352795 516636 682556 851217 1012475 1180256 1343384 1493307

> (ages <- mean(data$AGE))
 [1] 28.97636

以下是lca()函数调用的输入参数

out <- lca(xyz, years = c(2006:2014), ages = mean(all.mod2014$AGE), 
             adjust="dt", restype = "rates")
Error in pop * mx : non-conformable arrays

0 个答案:

没有答案