[R] GEE - order of data?
Anna Berthinussen
bs06ab at leeds.ac.uk
Mon Jan 31 13:21:45 CET 2011
Dear all,
I am trying to do a GEE on count data and I am having problems with
how to order the data. Below is a simplified example of what my data
looks like..
Route Time Day Pass Distance
1 30 1 4 0
1 60 1 12 200
1 120 1 25 600
1 30 2 8 0
1 60 2 17 200
1 120 2 32 600
2 30 1 0 0
2 60 1 4 200
2 120 1 11 600
2 30 2 3 0
2 60 2 42 200
2 120 2 3 600
etc...
My basic model: geeglm(Pass~Distance, id=Route, corstr="ar1")
Pass is the response variable (counts). I collected data along
different routes (these represent the grouping structure, id=Route).
As I walked each route I collected count data at different distances
and times, therefore I need an AR-1 auto-correlation structure for the
within route correlation. I gather that data must be organised within
each block according to the time variable. However, I also completed
each route on 2 separate nights, which makes ordering the data more
complicated. Do I still just order the data within each block
according to time (ignoring the fact that data were collected on
different days), or do I need to somehow specifiy that the data were
collected at different times on different days within each route? And
how would this be done correctly?
I hope that makes sense. Any help would be much appreciated.
Thanks in advance,
Anna
More information about the R-help
mailing list