View source: R/predict_support.R
predict.ps2dglm | R Documentation |
ps2DGLM
Prediction function which returns both linear
predictor and inverse link predictions at arbitrary (x, y) data locations
(using ps2DGLM
with class ps2dglm
).
## S3 method for class 'ps2dglm'
predict(object, ..., XY, type = "mu")
object |
an object using |
... |
other parameters. |
XY |
a matrix of arbitrary ( |
type |
the mean value |
pred |
the estimated mean (inverse link function) (default)
or the linear predictor prediction with |
Paul Eilers and Brian Marx
Eilers, P.H.C., Marx, B.D., and Durban, M. (2015). Twenty years of P-splines, SORT, 39(2): 149-186.
Eilers, P.H.C. and Marx, B.D. (2021). Practical Smoothing, The Joys of P-splines. Cambridge University Press.
library(fields)
library(JOPS)
# Extract data
library(rpart)
Kyphosis <- kyphosis$Kyphosis
Age <- kyphosis$Age
Start <- kyphosis$Start
y <- 1 * (Kyphosis == "present") # make y 0/1
fit <- ps2DGLM(
Data = cbind(Start, Age, y),
Pars = rbind(c(1, 18, 10, 3, .1, 2), c(1, 206, 10, 3, .1, 2)),
family = "binomial", link = "logit")
predict(fit, XY = cbind(Start, Age)[1:5,])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.