data(Epil) my.center = function(x) (x - mean(x)) Epil$CTrt = my.center(Epil$Trt) Epil$ClBase4 = my.center(log(Epil$Base/4)) Epil$CV4 = my.center(Epil$V4) Epil$ClAge = my.center(log(Epil$Age)) formula = y ~ ClBase4*CTrt + ClAge + CV4 + f(Ind, model="iid") + f(rand, model="iid") ## Now I want the posterior for ## ## 1) 2*CTrt - CV4 ## 2) Ind[2] - rand[2] ## lc1 = inla.make.lincomb( CTrt = 2, CV4 = -1) names(lc1) = "lc1" lc2 = inla.make.lincomb( Ind = c(NA,1), rand = c(NA,-1)) names(lc2) = "lc2" ## default is to derive the marginals from lc's without changing the ## latent field result1 = inla(formula,family="poisson", data = Epil, lincomb = c(lc1, lc2), verbose=TRUE, keep=TRUE, control.compute=list(q=TRUE)) ## but the lincombs can also be additionally included into the latent ## field for increased accurancy... result2 = inla(formula,family="poisson", data = Epil, lincomb = c(lc1, lc2), verbose=TRUE, keep=TRUE, control.inla = list(lincomb.derived.only = FALSE), control.compute = list(q=TRUE))