Hi,
I'm trying to predict survival times using a fitted survReg object that
includes a gaussian frailty, e.g.
fit.final3<-survReg(Herb.surv~Species*Understory+Protection+Overstory*Understory+
frailty(Plot,distribution="gaussian",sparse=F),data = Herb.factor,
dist = "loglogistic")
I can successfully use predict() with the existing data, e.g.
Y<-predict(object=fit.final3)
> Y
[1] 1519.68175 2159.55649 635.31659
[4] 57.54016 902.94895 696.96931 ... etc.
but if I use new data, e.g.
> Herb.factor.pred[1:5,]
Species Understory Overstory Protection Plot
1 Acru NonRhodo Gap U Ln1
2 Acru Rhodo Gap U Ln1
3 Acru NonRhodo Gap P Ln1
4 Acru Rhodo Gap P Ln1
5 Acru NonRhodo Canopy U Ln1
I encounter the following error
> Y <- predict(object = fit.final3, newdata = Herb.factor.pred)
Error in model.matrix.default(T..: No data for variable "frailty(Plot,
distribution = "gaussian", sparse = F)"
What am I doing incorrectly?
Secondly, is there a way make predictions using the parameters estimated
with the frailty term but without including the frailty term in the
predictions (e.g. with frailties equal to 0)?
I'm using Splus 2000 r3.
Thank you,
Brian Beckage
|