On Thu, 2014-02-20 at 06:14 -0800, Olivier Nuñez wrote:
> Dear Håvard,
>
>
> you're right.While simplifying notations, I forgot some terms in the
> code.
> A more accurate version of my model is actually:
>
>
> formula = counts ~ 1 + f(i,model="bym", graph.file="mygraph") +
> f(t,model="rw1") +
> f(i2,model="bym", graph.file="mygraph",group=t,
> control.group=list(model="rw1"))
>
>
> What I try to do, is to fit a RW1 process for each county taking into
> account the spatial dependence. It is likely that my interpretation of
> the "group" feature is not correct. Is the following syntax more
> accurate?
>
>
> formula = counts~1 + f(i,model="bym", graph.file="mygraph") +
> f(t,model="rw1") +
> f(t2,model="rw1",group=i,
> control.group=list(model="besag",graph.file="mygraph"))
I attach some slides about the group option. both your options hsould be
the same, as 'a' grouped with 'b' is the same as 'b' grouped with 'a'.
the problem is that you will have a confounding
formula = counts ~ 1 + f(i,model="bym", graph.file="mygraph") +
f(t,model="rw1") +
f(i2,model="bym", graph.file="mygraph",group=t,
control.group=list(model="rw1"))
between f(i,...) and f(i2,...), so I suggest you take f(i,...) away. if
you could add linear constraints so that i2 sums to zero over all time
points for each index in i2, this would go away, but that is not a good
idea really.
Also, I think I would go away from the 'bym' model as this is a joint
model between the structured and unstructured term, and although you can
'group' with with 'rw1', it is questionable to connect the intrinsic
model and the iid model component in the same way in time.
you might just want to replace 'bym' with 'besag' ???
In any case, I would suggest to run a small simulation study where you
simulate from the model and estimate it back, to verify that all is
correct.
Best