Examples and tutorials‎ > ‎Volume I‎ > ‎

Code for Zambia example

data(Zambia)

#load map
g = system.file("demodata/zambia.graph", package="INLA")

# add one column for the unstructured spatial effect
Zambia$distr.unstruct  =  Zambia$district

formula = hazstd ~ f(inla.group(bmi),model="rw2") + f(agc,model="rw2") +
                        f(district,model="besag",graph=g, param=c(1,0.01)) +
                        f(distr.unstruct,model="iid",param=c(1,0.01)) +
                        rcw+edu1+ edu2+ tpr+ sex

mod.zambia  =  inla(formula,data=Zambia, control.fixed = list(prec.intercept = 0.001, prec = 0.001), verbose=TRUE)
Comments