My question regards the use of the gamlss
package. I am using gamlss
package to fit a dataset to a logistic function. There is only one predictor, let me denote it with x
and because the overall dependence is not exactly sigmoid, a better model is achieved by wrapping the predictor x
in a smoother function. I chose the cubic spline smoother (cs
). The response is binomial. I'll denote it with y
:
y = cbind(number of successful events, total number - number of successful events).
The R code is the following:
cs15 <- gamlss(y~cs(x, df=15), sigma.fo=~1, family=BI, data=mydata, trace=FALSE)
I want to estimate predicted response for a set of predictors not contained in the original data set. I know this can be achieved with the function:
cs15fit = predict(cs25, newdata=data.frame(x=xnew), type="response")
However, my problem is that I also want to estimate the standard errors, which should be done by adding se.fit=T
:
cs15fit=predict(cs25, newdata=data.frame(x=xnew), type="response", se.fit=T)
But the addition of se.fit = T
produces the following error:
se.fit = TRUE is not supported for new data values at the moment
Anyone know how I can still find standard errors for the new values?