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,])
Run the code above in your browser using DataLab