Learn R Programming

cpr (version 0.4.1)

predict.cpr_cp: Model Prediction

Description

Model prediction for cpr_cp and cpr_cn objects.

Usage

# S3 method for cpr_cp
predict(object, ...)

Value

the same as you would get from calling predict

on the object$fit.

Arguments

object

a cpr_cp or cpr_cn object

...

passed to predict

Examples

Run this code

acp <- cp(log10(pdg) ~ bsplines(age, df = 12, bknots = c(45, 53))
           , data = spdg
          , keep_fit = TRUE)
acp_pred0 <- predict(acp$fit, se.fit = TRUE)
acp_pred <- predict(acp, se.fit = TRUE)
all.equal(acp_pred0, acp_pred)

Run the code above in your browser using DataLab