'from' must be a finite number.

60 views
Skip to first unread message

Enyu Tong

unread,
Jun 16, 2024, 9:14:39 AM6/16/24
to R-inla discussion group
Dear respected members of the INLA community,

I have been trying to use the BAPC/INLA package to project age-standardized rates. Below is the code I am using:

if(requireNamespace("INLA", quietly = TRUE)) {
    require(INLA)
    data(FemLCSweden)
    data(FemPYSweden)
    data(whostandard)

    lc_sweden <- APCList(FemLCSweden, FemPYSweden, gf=5)

    result  <- BAPC(lc_sweden, predict=list(npredict=10, retro=TRUE),
        verbose=FALSE, stdweight=whostandard[6:17,2])

    plotBAPC(result, scale=10^5, type="ageSpecProj", showdata=TRUE)

    ## Assume the data for 2000 to 2010 are not observed
    ## (projection results are the same as above)
    FemLCSweden[51:60,] <- NA

    lc_sweden <- APCList(FemLCSweden, FemPYSweden, gf=5)

    result  <- BAPC(lc_sweden, predict=list(npredict=10, retro=FALSE),
        verbose=FALSE, stdweight=whostandard[6:17,2])

    plotBAPC(result, scale=10^5, type="ageSpecProj", showdata=TRUE)
}

However, I keep encountering the error: Error in seq.default(xmin, xmax, length.out = n) : 'from' must be a finite number.

I have tried multiple attempts to troubleshoot this issue, but it persists. Could you please guide how to resolve this error?

Best regards,
Enyu
Reply all
Reply to author
Forward
0 new messages