Skip to content
Prev 4953 / 29559 Next

Different Moran's I for same model residuals in different runs using moran.mc{spdep}

On Sat, 31 Jan 2009, Xingli Giam wrote:

            
Unless you set the seed to the random number generator for the Monte Carlo 
procedure (set.seed()), each run will get a different stream of numbers, 
hence give possibly somewhat different results, won't it? However, the 
"statistic" component of the returned object that you are extracting is 
the same as that returned by moran.test(), and will not change for the 
same input data and spatial weights.

Please take a longer coffee break (or your prefered beverage), think 
through what you are trying to do, read the relevant literature, make some 
simple examples, and you'll find that you've resolved most of your 
concerns. You are trying to do too much, too fast (deadline?), without 
grasping the essence. If you simplify, you'll see how to do things.

Have you looked at correlog() in pgirmess, which effectively does what you 
"seem" to be trying to do - I pointed this out in a reply several days 
ago?

Roger

PS. Using moran.mc() or moran.test() on residuals is in any case 
inappropriate, you probably ought to be using lm.morantest() on the lm() 
or glm() output object (glm() not well founded in the literature).