Hi I am trying to reproduce the results of the LIpCancerData to graph posterior p-value.
It gives me these errors:
Error in seq.default(xmin, xmax, len = n) :
'from' must be a finite number
In addition: Warning messages:
1: In max(marginal[["y"]]) :
no non-missing arguments to max; returning -Inf
2: In min(x, na.rm = na.rm) :
no non-missing arguments to min; returning Inf
3: In max(x, na.rm = na.rm) :
no non-missing arguments to max; returning -Inf
4: In min(m[["x"]]) : no non-missing arguments to min; returning Inf
5: In max(m[["x"]]) : no non-missing arguments to max; returning -Inf
The codes I am using are as follows:
formula.inla <- O ~ 1 + X + f(id,model="iid", hyper=list(prec=list(prior="loggamma",param=c(1,0.0001))))
lipcancer.poisson <- inla(formula.inla,family="poisson",
data=LipCancerData, offset=log(E),
control.predictor=list(link=1, compute=TRUE),
control.fixed=list(mean=0,prec=0.00001))
summary(lipcancer.poisson)
n<-length(LipCancerData[,1])
predicted.p.value <- c()
n <- length(LipCancerData[,1])
for(i in (1:56)) {
predicted.p.value[i] <- inla.pmarginal(q=LipCancerData$O[i],
marginal=lipcancer.poisson$marginals.fitted.values[[i]])
}
Alok